Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Import Multiple excel sheets at once

Hi Friends,

Is this possible to import multiple sheets from an excel file at once? If yes then please share the steps or logic for that.

Regards

Bhawna   

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you mean using a wildcard like *, then no. You need to loop over the sheets. You can use a For loop, like:

     For i = 1 To 10

          LOAD * From Mysheet.xlsx (ooxml, sheet is Sheet$i));

     Next

If the names never change:

     For Each vSheet In 'Detail', ''Summary', 'Last Year'

          LOAD * From Mysheet.xlsx (ooxml, sheet is $(vSheet));

     Next

Or if the names are more complicated, you can use an ODBC connection to get the list of sheet names and loop over this list.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you mean using a wildcard like *, then no. You need to loop over the sheets. You can use a For loop, like:

     For i = 1 To 10

          LOAD * From Mysheet.xlsx (ooxml, sheet is Sheet$i));

     Next

If the names never change:

     For Each vSheet In 'Detail', ''Summary', 'Last Year'

          LOAD * From Mysheet.xlsx (ooxml, sheet is $(vSheet));

     Next

Or if the names are more complicated, you can use an ODBC connection to get the list of sheet names and loop over this list.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks Jonathan,

with little changes

replace sheet is with Table is and Sheet$i with Sheet$(i)

after making changes the script runs fine and load all the sheet at once.