Hello,
I want to save the results of various variables into an Excel Workbook. All the results I want to save are on the “Multiple Iteration Dashboard ” Page I created. I read about the function PageCopyTableToExcel that would allow me to save those results (https://documentation.aimms.com/functionreference/user-interface-related-functions/page-functions/pagecopytabletoexcel.html#pagecopytabletoexcel).
You can find my projects attached to this question.
To do so, I created a Procedure named “ExportExcel” where you can find the following code :
if not axll::WorkBookIsOpen(WorkbookFilename : "Book1.xlsx" ) then
axll::OpenWorkBook(WorkbookFilename : "Book1.xlsx" );
endif;
PageCopyTableToExcel(pageName: "Multiple Iteration Dashboard",
tag: "FuelEfficiency",
includeHeaders: 1,
selectionOnly: 0,
ExcelWorkbook: "Book1.xlsx",
Range: "A1:Z150");
I went into the Fuel Efficiency Table Properties to correctly tag it as “FuelEfficiency”.
However, I got this error : “PageCopyTableToExcel(ExcelWorkbook: Book1.xlsx) failed: Unable to get a handle to the workbook.”
The Excel workbook is in the same file as my AIMMS Project so I don’t understand why I got this error.
Could you help me please? Do you now another way to save my results in Excel?
Thank you very much!