This thread is a bit old, but I had the same problem when I needed to modify Excel files using macros from PHP. No PHP librairy, which I know, supports editing Excel files without adversely affecting macros.
However, the LibXL library supports saving macros from version 3.3.1. It is not written in PHP, but what we ended up with is writing our Excel editing in C ++, and we called this C ++ program from PHP using the exec () method. It worked very well and had very good performance. Hope this helps someone.
source share