How to export excel file (xlsm format) with libXL library

2.2k Views Asked by At

In my iOS application, I want to generate the excel(.xlsm) file. I used the libXl library.(http://www.libxl.com/) This library can support Excel 97 -2003 formats (xls) and Excel 2007-2013 xml formats (xlsx/xlsm) by referencing in the home page. Now my problem is I can export xlsx file fomat but cannot export the xlsm application in my application . Do you know how to do this?

1

There are 1 best solutions below

0
On

You can't use libXL to create macros, but you can preserve existing macros. I.e. you can take an excel macro-enabled file as a template, read it with libXL, make some modifications and save.

To save .xslm rather than .xslx you only need to give the file a different extension. File format is the same. Excel won't open an .xlsx file if it has embedded macros, but it's only a convention.