Forum Moderators: coopster

Message Too Old, No Replies

export to Excel?

         

jackvull

8:03 pm on Nov 22, 2007 (gmt 0)

10+ Year Member



I have an application written in Access VBA. Part of the application has an export to Excel button where it automatically runs a load of code in Excel.
Is this possible with PHP?
Ideally, I'd like a button on a webpage, which users can press and it runs the same VBA code in Excel.
If not are there alternatives, like storing an Excel template on the server with a macro in it that I can force a download to the client?

jackvull

10:59 pm on Nov 22, 2007 (gmt 0)

10+ Year Member



Or I have an Excel template with an autoexec macro in it that runs a stored procedure from the SQL database and then all the VBA code inside it.
PHP then forces a download?

What's best?

All the VBA code does is formatting of the spreadsheet essentially making it a neat report with bolded headings, number formatting, currency formatting, etc.

jatar_k

12:00 am on Nov 23, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I would do the macro and then have php do the download, vb is more appropriate for creating proper excel files, plus it is already done

jackvull

9:59 am on Nov 23, 2007 (gmt 0)

10+ Year Member



So I guess it needs to be an Excel autoexec macro?
Problem is I need to save a template of the Excel file with the macro on the server. How do I get the data into this file without overwriting it?