Solved

Write Out Data To Excel

  • 12 September 2022
  • 2 replies
  • 204 views

Userlevel 1
Badge

Hello everyone,

 

i want to read out Data from my project to excel. In Order to do so i created the following code:

 

if not axll::WorkBookIsOpen(WorkbookFilename : "data//Auswertung_Szenario2.xlsx" ) then
        axll::OpenWorkBook(WorkbookFilename : "data//Auswertung_Szenario2.xlsx" );
endif;

axll::SelectSheet(SheetName : "Tabelle1" );

axll::WriteTableQuick(
        IdentifierReference : LeadTimeOfOperation ,
        TopLeftCell         : "A5" ,
        RowDimension        : 1,    
        WriteZeros          :  0,);

 

I dont get any error codes when i run the Procedure and the LeadTime Parameter is also not empty, but in my Excel Sheets i still cant see the Data. 

Does anyone know why that could be the case ? 

 

Kind regards

Alex

icon

Best answer by AlexK 12 September 2022, 18:04

View original

2 replies

Userlevel 5
Badge +6

Hi!

Tried to reproduce your example, but, to use axll::WriteTableQuick the parameter needs to be with one dimension or more. With no dimension, I received an expected error. Did you tried axll::WriteSingleValue(ScalarReference,Cell) ?

Either way, in this example I used both import and export with AXLL library. Check this (https://github.com/aimms/knapsack) out!

Userlevel 1
Badge

Hi!

Tried to reproduce your example, but, to use axll::WriteTableQuick the parameter needs to be with one dimension or more. With no dimension, I received an expected error. Did you tried axll::WriteSingleValue(ScalarReference,Cell) ?

Either way, in this example I used both import and export with AXLL library. Check this (https://github.com/aimms/knapsack) out!

Hi,

 

i didn´t think about specifying that but the reference parameter is actually indexed. Its LeadTimeOfOperation(i). I just didnt know i had to write that in this part of the code aswell since it didnt give an error message. Now i tried it and it works.

Thank you.

 

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator