bobboau
Content Type
Profiles
Forums
Events
Posts posted by bobboau
-
-
OK, so I am trying to write a small summary page that will read in data from a few excel files that a bunch of people have all around our office, and display it on a public display board. I have a vista business computer set up with Apache running in the background as a service (it should be using my user credentials).
the problem is when ever I try to open a file through the excel object I got through PHP's COM interface, it fails giving the generic "can't open it" error.
I can open the file just fine if I go to it and double click or if I type the address into the address bar.
if I do not try to open a file the excel object seems to work fine, but it's fairly useless if I can't open any files
I have tried turning off the firewall with no effect.
I have tried turning off UAC with no effect.
at the moment everything is happening on the same machine so there really should be no network complications at this point.
the files are in the public directory so anyone should have access to them.
the code I am testing with at this moment is this
$PPMH_path = "C:\\Users\\Public\\test.xls";
try{
$excel=new COM("excel.application") or die("unable to start Excel on server!");
$excel->DisplayAlerts = 0;
$excel->Visible = 0;
$excel->Workbooks->Open($PPMH_path);
$excel->Quit();
} catch (Exception $e) {
echo "\n**error** ".$e;
$excel->Quit();
}the error I get is this
exception 'com_exception' with message 'Source: Microsoft Office ExcelDescription: Microsoft Office Excel cannot access the file 'C:\Users\Public\test.xls'. There are several possible reasons: • The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook.' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\info\info.php:16 Stack trace: #0 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\info\info.php(16): variant->Open('C:\Users\Public...') #1 {main}
0
Excel/php/com problems
in Web Development (HTML, Java, PHP, ASP, XML, etc.)
Posted
the problem is that these are files being used by other people I have no choice but to use several different versions of excel files, if this would just work as advertised everything would be fine, but it doesn't, I'm starting to get the impression that I'm the only person using this interface because the only references to it I find through google are my own unanswered pleas for help.