Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid losing macros in PHPExcel?

I'm using PHPExcel to read data from a database and put it into a spreadsheet. I also have a template (.xlsm file) to be followed. As everybody knows, PHPExcel doesn't support macros. But I don't want to edit or create the macros. I just wanna make sure they remain where they are. Don't even want to touch them.

So, does anybody know any workaround for that?

I've been working on this for a week now. I already read this and this. The problem with the first solution is that my server is a Debian so I can't try Libxl approch.

In codeplex I've found the following solution on Chads2000's comment, but I aint seem to be able to make it work. I'm desperate.

Thanks all for your attention, in antecipation.

like image 757
Dennis Braga Avatar asked Jul 23 '13 12:07

Dennis Braga


1 Answers

Well, I figured this out quite a long time ago: here's the answer. A guy made a workaround. First, he separate the macros files (VBA) from the sheet, then he left the PHPExcel "doing his thing", e then put it back (the macros!). It was enough for me! :D

like image 89
Dennis Braga Avatar answered Sep 17 '22 23:09

Dennis Braga