php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50908 Office 2007 error
Submitted: 2010-02-02 11:51 UTC Modified: 2020-02-09 04:22 UTC
From: niragorri at hotmail dot com Assigned: cmb (profile)
Status: No Feedback Package: COM related
PHP Version: 5.3SVN-2010-02-02 (SVN) OS: Windows 7
Private report: No CVE-ID: None
 [2010-02-02 11:51 UTC] niragorri at hotmail dot com
Description:
------------
There is an error when using Office 2007 to access an excel sheet when your under Windows XP using the php COM class. But you can still access it. However, if you're using Windows 7 with any version of office you can't use the COM class to access the excel file. The same script that worked for me under XP was useless in 7.

Reproduce code:
---------------
$excel = new COM ("Excel.sheet");
			$excel->Application->DisplayAlerts = false;
			$abrir = $excel->application->Workbooks->Open($hojita);
			$excel->Application->Visible = 1;
			
			//se abre la hoja1 donde se encuentran los datos del proyecto y se llama a la funcion llenarformato
			$hoja = $abrir->Worksheets("Hoja1");
			$hoja->activate;
			$contcol=1;
			$contfil=1;
			while (utf8_encode ($hoja->Cells(1, $contcol))!= ""){
			  $contcol++;
			}
			while (utf8_encode ($hoja->Cells($contfil, 1))!= ""){
			  $contfil++;
			}
			$numFil=$contfil-1;
			$numCol=$contcol-1;
			
			$maxFil=$numFil;
			$maxCol=$numCol;

Expected result:
----------------
I expected it to access an excel document and report the number of columns and rows of a specific sheet. In most Windows 7 systems


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-27 13:31 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-01-27 13:31 UTC] cmb@php.net
The script (with necessary modifications) works for me on Windows
10 Version 1909 with PHP 7.3.14.  Do you still experience issues?
If so, please provide the error message(s) reported by PHP.
 [2020-02-09 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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC