However both of them do not support XLSM, they do cool with XLS though. I have searched all over the internet and didn't find a library, or a method with PHP to do so.
By the way, my environment is *NIX.
I do not need to edit macros itself. I don't want to touch them, but I want a library/wrapper/command line executable(as last resort) to work with XLSM files(XML Sheets with Macros).
We've faced the exact same problem as you mentioned where we need to modify Excel workbooks but to do not want to impact the existing macros.
To do so, we've used the LibXL library and as of version 3.3.1 it supports the preservation of macros for .xls files. It is not written in PHP, therefore we wrote a small C++ program and then we call this program from php via the
exec() PHP method. It works very well.
This is completely out of my knowledge as I'm only familiar with
However there might be something for you in this discussion about
Read/Write macro in .xlsm?
There seems to be no library but this sure looks promising.
Read/Write macro in .xlsm