I have an Excel file that runs some code to tidy up data. This is automated from Access VBA.
I know want the users to download this file from some PHP code, i.e. the Excel file is a template on the server. I export the data to an Excel file in HTML table format. The Excel file then needs to run its macro when opened.
Any ideas on how to do this? Obviously it needs to wait for the data to put into the sheet before the code runs so I actually have to open the file first anyway in code.

My alternative is to include the SQL server stored procedure name in the AutoExec macro but that relies on Excel having the Microsoft Query add-in doesn't it and not all users will have this. Though I suppose it doesn't matter as long as the server has it...