The upgrade went surprisingly well. A couple of PHP.ini settings and getting the appropriate PEAR packages installed was the majority of work. The one issue was with Excel and COM.
I'm posting below the change that I had to make to the code. From various Google searches I doubt the other 3 PHP developers on the planet using PHP and COM to talk to Microsoft Office will find the below helpful. Regardless here is the change:
- I initially used the below to write values to a specific spreadsheet, the solution was found here:
foreach($data as $key => $value ){
$excel_cell = $Worksheet->Range($key);
$excel_cell->activate;
$excel_cell->value = $value;
} - The cell->activate call was not working and I modified the code to the below, suggested here:
foreach($data as $key => $value ){
$excel_cell = $Worksheet->Range($key)->Value = $value;
}
Finally, a stern warning from Microsoft that the process I'm using is a bad idea.
No comments:
Post a Comment