Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ecrobles18
Contributor III
Contributor III

How do I read multiple tabs and exclude certain tabs when reading from excel in sharepoint?

Hello All,

I am currently trying to pull in data from Excel spreadsheets in a document library in SharePoint. The issue is that I can read the files but there are three tabs that are standard in every workbook that I will not need to read. Every worksheet will contain the same column name. Another thing is that not all the workbooks will contain the same number of tabs and will not have uniform names. How can I write the script to call all the workbooks and pull in the necessary information yet exclude the three tabs? Thank you in advance for any help you can offer.

- Emmanuel

2 Replies
Ralf-Narfeldt
Employee
Employee

This should help you with looping through the files and sheets. Basically, you need to connect to each file using ODBC to get the list of Sheets to loop through. To exclude some sheets, you would need to add a IF around the Load.

Loading from multiple Excel files and multiple sheets

ecrobles18
Contributor III
Contributor III
Author

I am not trying to pull data from SQL. I am trying to pull the data from a SharePoint site so would I still need to setup the ODBC connection? I understand adding the IF statement to exclude the sheets I do not need but, I am not certain on how to have the script loop through the all the files in SharePoint. Would the web address serve as the ODBC connection.