Export DataTable to Macro Enabled Worksheet

Export DataTable to Macro Enabled Worksheet

SDAParksSDAParks Posts: 3Questions: 2Answers: 0

Hello,

I was wondering if there is any way to export data from a DataTable to a macro enabled workbook.

At the time of initializing the DataTable in my code, the "extension" property is set to ".xlsm". After exporting the data and attempting to open the file, I get a notification in excel that the file extension or format is not valid.

Is there anything that can be done to adjust the format of the file so the data can be exported to a macro enabled workbook?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,790Questions: 26Answers: 5,042
    edited March 12 Answer ✓

    Likely you will need to use the customize function of the excelHtml5 button to change the format. You can compare the differences of an XLSX versus an XLSM file by unzipping then and investigating the XML.

    Another option, which might be easier, is to use SheetJS with a custom button to export to XLSM. According to their supported formats docs they support XLSM. This example from this thread shows a simple example of using SheetJS.

    Kevin

  • SDAParksSDAParks Posts: 3Questions: 2Answers: 0

    Thanks Kevin!

    Scott

Sign In or Register to comment.