brechtsanders / xlsxio

XLSX I/O - C library for reading and writing .xlsx files
MIT License
397 stars 113 forks source link

Unable to read file with macros (XLSM) #94

Closed bcTekGuy closed 3 years ago

bcTekGuy commented 3 years ago

This is more of an enhancement than an issue. In order to read XLSM files I added the following:

To function - DLL_EXPORT_XLSXIO int xlsxioread_process

list_files_by_contenttype(handle->zip, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml", main_sheet_get_sheetfile_callback, &getrelscallbackdata, NULL); if (getrelscallbackdata.sharedstringsfile == NULL) //Look for XLSM list_files_by_contenttype(handle->zip, "application/vnd.ms-excel.sheet.macroEnabled.main+xml", main_sheet_get_sheetfile_callback, &getrelscallbackdata, NULL);

There is another location that the content type is used in "xlsxioread_sheetlist_open", I'm only ready a file with a single sheet, so I don't use this function.

Seemed such a minor change to be able to read both types of files.

brechtsanders commented 3 years ago

Not sure what you needed to change exactly as xlsm file support was already in lib/xlsxio_read.c since 0.2.24. Were you using an old version of the library?

bcTekGuy commented 3 years ago

My apologies.  I actually had that exact thought (that I should check for updates) about an hour after I sent the email. I was using version 2.21, and with all the craziness happening, it didn't feel that long ago that I last upgraded (but that version came out over a year ago). Keep up the great work, your product is amazing! Dave

On Saturday, February 6, 2021, 04:42:32 a.m. PST, Brecht Sanders <notifications@github.com> wrote:  

Not sure what you needed to change exactly as xlsm file support was already in lib/xlsxio_read.c since 0.2.24. Were you using an old version of the library?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.