Just wondering if it's possible to find the IDEA version number from within a script. Our organisation is running IDEA 8.5 generally but have IDEA 9.1 on some computers and will be migrating there sometime in the future for the rest. I have a script where I would like to know which version it is running under so that it can handle the differences between 8.5 and 9.1 in importing files with [ and ] brackets in the source file names (8.5 allows the brackets but 9.1 can't handle it). This is a common occurrence for us as we see a lot of MYOB systems and some of the common MYOB reports default to brackets in the file names.
In Excel VBA I can use Application.Version to get the Excel version number. I tried this with IDEAscript. In 8.5 it returned nothing. In 9.1 it crashed.
Ken Brown
Offline
Last seen: 9 years 9 months ago
Joined: 07/15/2014 - 02:23
Hi Ken and welcome to the site.
IDEA doesn't have a function to get the version number but I use the following routine to obtain the version number. The function tests to see if a function available only in V9 works, if it gives an error it knows that you are using V8 else it returns V9. Hopefully this will help you out.
Thanks Brian. That's great for the the situation I had above. Unfortunately I now have another issue where I would like to be able to distinguish between IDEA 9.1 and 9.2 and I guess your technique won't work for that. In Australia our financial year ends on 30 June and the second parameter for @FinYear should therefore be "0630". This is how it was in 8.5 but in 9.1 you have to put in "0631" to make it work correctly. I have been told that this has been fixed back to "0630" in 9.2 so if my script knew it was running in just 9.1 it could allow for problem. At least your technique will help with our transition from 8.5 to 9.1. I guess I need to hope there is a new function to test for in the next version we migrate to. Thanks again.
Ken, you could try something out like this. I don't have access at the moment to V9.1 so I am not sure what the result would be but as you can see you use the function and test for the different results to see if you are using 9.1 or 9.2. The script probably needs some tweaking to make sure it captures the differences between the two.
Thanks Brian. Great solution. Worked well in showing the difference between 8.5 and 9.1, so should continue to work when the problem is fixed in the next version we move to. Thanks again.
Hi Ken, glad it worked.