Using IDEA Script to import first excel worksheet in file

4 posts / 0 new
Last post
karlfmullen
Offline
Joined: 05/11/2020 - 06:47
Using IDEA Script to import first excel worksheet in file

HI
I am trying to create a script that will automatically import the first excel worksheet for an excel (,xlxs) file.  In each case when i run the script I want to import the first worksheet in the file regardless of the worksheet name. The excel file will always have the same name however the worksheet name will change depending on the date it is run.
Is there a way I can do this using IDEA script? To import the worksheet at present, i have to specify the sheet name each time e.g. task.SheetToImport = "sales01012020".
 
Any assistance would be appreciated.
 
Thanks
 
Karl

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

It you are importing the first sheet or it only has one sheet just comment out that line and IDEAScript will import the first worksheet.

karlfmullen
Offline
Joined: 05/11/2020 - 06:47

Many thanks Brian. Didn't realise it was that simple.
 
Karl

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

Hi Karl, sometimes it isn't but we are lucky in this case.