Topics: Developer Forum
Jul 3, 2008 at 9:35 AM
Edited Jul 3, 2008 at 9:36 AM

I am totally new here as well as new to the PHP. But I am able to create the excel file 2007 (.xlsx). Thanks for that.  Is there any way to create or write in the .xlsm file ( Excel Macro-Enabled Workbook)? Thanks in advance.

Jul 3, 2008 at 10:45 AM
It is possible to save as .xlsm, but adding macro's is currently not possible.
Jul 14, 2008 at 12:31 PM

Thanks maartenba.

 Actually I wrote a macro /user define function. Now I want if user enter anything I will take that as input (will put in A1 of sheet1 which contains my function as vba code) and do some calculation and put the result in say B1 of sheet1. Now I will take result from B1 and will show to User. Is this possible with current version? If yes can you give some sample code?

Jul 15, 2008 at 7:33 AM
This is currently not possible with PHPExcel. You can however inject a macro file (check www.openxmldeveloper.org for examples in other languages than PHP) and use the user defined function with PHPExcel as long as you set precalculate formulas to false.