php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54353 Outputs While trying to call
Submitted: 2011-03-22 18:10 UTC Modified: 2020-02-16 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: drmorgue at yandex dot ru Assigned: cmb (profile)
Status: No Feedback Package: COM related
PHP Version: 5.5.1 OS: Windows7/Windows 2008 Server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: drmorgue at yandex dot ru
New email:
PHP Version: OS:

 

 [2011-03-22 18:10 UTC] drmorgue at yandex dot ru
Description:
------------
On my WinXP computer with Office 2003 all work correctly, php-script (see it in 
section 'test script') generates ms-excel file 1.xls. But on the computer with 
windows2008server this php-script generates an error: 

Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> 
Microsoft Office Excel<br/><b>Description:</b> Невозможно получить свойство Save 
класса Workbook' in C:\www\prj\1.php:12 Stack trace: #0 C:\www\prj\1.php(9): 
variant->Save() #1 {main} thrown in C:\www\prj\1.php on line 9

My php installed as an apache handler.

How to solve it?

Test script:
---------------
$x = new COM("Excel.Application");
$x->Application->Visible = 1;
$x->Workbooks->Add();
$x->ActiveSheet->StandardWidth = 5;
$r = $x->Range("a:a");
$r->Select();
$rc = $x->Selection();
$rc->ColumnWidth = 50;
$x->Workbooks[1]->SaveAs("c:/1.xls");
$x->Quit();
$x->Release();
$x = Null;
$r = Null;

Expected result:
----------------
File 1.xls must be generated and saved into C:\

Actual result:
--------------
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> 
Microsoft Office Excel<br/><b>Description:</b> Невозможно получить свойство Save 
класса Workbook' in C:\www\prj\1.php:12 Stack trace: #0 C:\www\prj\1.php(9): 
variant->Save() #1 {main} thrown in C:\www\prj\1.php on line 9

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-01 22:52 UTC] yohgaki@php.net
-Operating System: Windows 2008 Server +Operating System: Windows7/Windows 2008 Server -PHP Version: 5.3.6 +PHP Version: 5.5.1
 [2013-08-01 22:52 UTC] yohgaki@php.net
Under Windows 7 Ultimate(32bit) & Office 2013's Excel & PHP 5.5.1, I got 
different error. (I changed save path to c:\php, since it raise write error)

C:\php>php t.php
PHP Fatal error:  Uncaught exception 'com_exception' with message 'Error 
[0x80020003] メンバーが見つかりません。
' in C:\php\t.php:12
Stack trace:
#0 C:\php\t.php(12): com->Release()
#1 {main}
  thrown in C:\php\t.php on line 12

Fatal error: Uncaught exception 'com_exception' with message 'Error [0x80020003] 
メンバーが見つかりません。 ("Cannot find member" in English)
' in C:\php\t.php:12
Stack trace:
#0 C:\php\t.php(12): com->Release()
#1 {main}
  thrown in C:\php\t.php on line 12
 [2020-02-07 08:38 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-02-07 08:38 UTC] cmb@php.net
This doesn't look like a PHP issue.  Please try the following
variant:

<?php
$x = new COM("Excel.Application");
$x->Application->Visible = 1;
$wb = $x->Workbooks->Add();
$x->ActiveSheet->StandardWidth = 5;
$r = $x->Range("a:a");
$r->Select();
$rc = $x->Selection();
$rc->ColumnWidth = 50;
$wb->SaveAs("c:/1.xls");
$x->Quit();
$x->Release();
$x = Null;
$r = Null;
?>
 [2020-02-16 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 11 23:05:44 2022 UTC