I have a Excel file with forms and controls. As it is not possible to create a Excel file with forms, controls and VBA code from scratch using PHP, I thought I could upload my e
Think in the other direction!
Instead of pushing data to excel from php, add a data connection to excel that will retrieve its data from a php endpoint taht publish xml.
Don't know if it applies, but it's far more easier to implement.
Moreover, you will have total control on the excel file, keeping all customisations, including VBA.
And finally, you will avoid all messy COM object managing if you end up in this direction.
[Edit] Steps for this solution :
yourdata.php
will produce the data in XML).After that, you will have a list in Excel, than is linked to your xml source. SImply right lick the list / refresh to get the latest data (or configure the data connection to auto refresh at opening).