When reading a table from an excel (and putting in wrong data) I get a pop-up in the UI stating what index it can't recognize and is therefore wrong, so something like this:
"ReadTable : Cell A2 in 'Excelfile': 'Wrong element' is not an existing element in the set 'Technical name of set'"
And I would like to use this information to make a specific pop-up for the end-user, so I can specify how to solve this error and also change the name of 'Technical name of set' to a name that they would recognize. So the exact element and index that are wrong, is stored somewhere, I would like to make use of this, but I can't find where to get this information.
Page 1 / 1
Hi @Guus Kattenbelt ,
The first article in this series will be helpful to you: https://how-to.aimms.com/C_Developer/Sub_Errors/index.html
You will be using the error handling functions included in AIMMS to specify a custom message to be displayed if an error occurs during a procedure run. Please review the content and if you still need help, you can reach out to the community.
The first article in this series will be helpful to you: https://how-to.aimms.com/C_Developer/Sub_Errors/index.html
You will be using the error handling functions included in AIMMS to specify a custom message to be displayed if an error occurs during a procedure run. Please review the content and if you still need help, you can reach out to the community.
Hi @mohansx ,
Thanks for the answer. I had already read these articles and saw that you can indeed specify your own custom message. The only thing I cannot find, is how to use information about where the reading of the excel went wrong in the excel.
The standard message says something about the specific element that is not recognized as an index in a set. I would like to create my own error message, using this information (which element, which set/index), but I do not see this option in the error handling.
Thanks for the answer. I had already read these articles and saw that you can indeed specify your own custom message. The only thing I cannot find, is how to use information about where the reading of the excel went wrong in the excel.
The standard message says something about the specific element that is not recognized as an index in a set. I would like to create my own error message, using this information (which element, which set/index), but I do not see this option in the error handling.
You should be able to capture the error message triggered by the excel interfacing functions using errh::Message and then you would have to do some string manipulations to extract the cell location and insert it in your own message.
I have indeed looked at this functionality. But then I get the full message and indeed need to do string manipulations. I was hoping that I could just get the index and set that are causing the error, such that I do not need to do any string manipulations.
Reply
Sign up
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.