Error when exporting to excel

6 posts / 0 new
Last post
Beetosh
Offline
Joined: 02/26/2021 - 09:31
Error when exporting to excel

I have a large DB that needs to be exported to several excel files using equations. E.g extract all records where Comp_code == ABC to file XX_ABC, extract all records where Comp_code == XYZ to file XX_XYZ. I am a newbie in IDEAScripting trying to automate this so that I don't have to repeat the same steps manually. When I run the script provided below to try it for one comp-code, i get a file limit error that says the data I am trying to export is larger that the max number of records, I believe that I am getting that error because IDEA is not capturing the equation in my extraction because when I do it manually using the same equation, it works; that error message comes up because the script is trying to extract the entire data, I got the error message when I tried to export the whole DB.
What is wrong with my script? The script I am using is a macro that I recorded when I extracted manually.

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Beetosh and welcome to the site.

To get around this problem you need to add the following line at the very top of the script under the Sub Main line

IgnoreWarning(True)

This will get rid of any warnings and the script won't give you that warning and continue on.  

Beetosh
Offline
Joined: 02/26/2021 - 09:31

Thanks for the quick response Brian, it is so great to find a forum for IDEA, great job!
I am not sure that the IgnoreWarning(True) will solve the problem, I am looking at the rootcause, why am I getting that warning? Is it because IDEA is attempting to extract the entire data instead of extracting based on the criteria that I provided? I don't expect to have that error message come up at all because the data that is being extracted based on the criteria(equation) is less than the number of records being flagged in the error message.
The fact that I am getting that error message implies to me that the criteria that I specified is being ignored. Could you please share your thoughts on this?

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Actually I tried this out on a 6 million record file and had the same problem as you.  When I added the IgnoreWarning(True) it removed the warning and the export worked as planned with the criteria in place.  

So this is just a warning, why you have it in the script and not when you do it through IDEA I am not sure.  If you click on yes to continue it will do the export.  In IDEA the warning is there if you don't use any criteria but with criteria it is no longer there which I view as being inconsistent.  I think it should still be there as even with a criteria the file could be over 1 million records.  I am going to put in a support ticket for this.  

Beetosh
Offline
Joined: 02/26/2021 - 09:31

Ignore warning fixed it. You have no idea how many hours I have spent trying to resolve this issue, hours and hours. Thank you so much!

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Glad I could help, good luck on your project.