Hi,
I created a report to export data in Excel. In the Excel file, data are to be formatted or re-treated. This operation can be automated by an event VBA macro.
Is it possible to create a java script which allows to create an Excel sheet with an included VBA macro and how ?
In advance thank you for your help.
Torsten Haase on
Hi,
it is not possible to create an Excel file with incuded Macro, but it should be possible to create such an Excel file manually, open it in the javascript report, let the report write to the opened excel file and save it as the report result.
To do this you need to
- create an excel file containing your macro
- import the Excel file to the script's category
- in the script use:
var xlsData = Context.getFile("template.xls", Constants.LOCATION_SCRIPT) var xlsWorkbook = Context.createExcelWorkbook(Context.getSelectedFile(), xlsData)- add your data to the workbook's sheet(s)
- save the workbook using