Solved

How can I disable warnings of the Excel library (AXLL)

  • 7 April 2020
  • 2 replies
  • 115 views

Userlevel 2
Badge +4

I am using the axll library to read my excel database into the Aimms. The number of observations in my database can change each time before running the model in Aimms, and I do not want to make changes to the datareading procedure each time. So, in the datareading procedure (which uses AXLL library) I set the reading row to a bigger number than the maximum number of observations to always read all the database no matter how many observations are in my database. 

For example: for an specific identifier, I can have 1 up to 5 rows of data. so I set the excel range as A1:A5. The problem is that I get warnings that the empty rows are ignored.

ReadList : Cell A6 in ActGrouping: Remaining rows are ignored after empty header cell.

I know this warning is not affecting my model but I just want to get rid of this warning so I can focus on other real warnings. 

p.s. I already turned off all warnings from Project Option menu, but still I get these axll warnings.

icon

Best answer by Richard Stegeman 8 April 2020, 13:04

View original

2 replies

Userlevel 2
Badge +3

The recommended way to use the axll library is by placing all function calls in a block-onerror-endblock scope. In the onerror clause you can then catch each error or warning and decide what to with it.

In this situation, check whether you are dealing with a warning (instead of error) and then call errh::markashandled() to make sure it is not propagated further.

Userlevel 6
Badge +6

Here a link to a How-to article on Error Handling, https://how-to.aimms.com/Articles/191/191-handle-errors-and-warnings.html

Reply


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

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