Open Each Excel in a file Directory (10,000+ Excels)

Rx_

Board Regular
Joined
May 24, 2011
Messages
52
Can anyone recommend VBA code that will loop through a directory file structure and list every Excel workbook, path, info to put into a database table?

A nice Excel Template was used to record CO2 emissions as the regulation started. The template was really well thought out.
Over the years, it turned from one person to a half dozen.
The Excel templates are highly organized in a file structure for Years, States, Location ID, and all of the data.

My efforts to design a SQL Server DB is about completed.
I have past experience to write code to open an Excel workbook and harvest the data and then close it (copying the data to SQL Server).

In the past, I had an interface that allowed a user to search and choose the directory and choose the one workbook to open. There are so many of these due to years of multiple people entering data as the CO2 tracking grew.

What is different this time: many people with thousands of Excel Workbooks. It would be better to automate the process of iterating through each directory, each workbook to harvest the information.

The interface will be Access 2010 (vba) with a SQL Server 2008 back end.
This code may be a one-time process to make the conversion.
Any references, examples, suggestions, web-links ... would be appreciated. I am also open to any recommended books or software tool purchaces.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Fantastic! Two really great sites.
Exactly my thoughts, import them into a local Access table, process some of the information then move the refined results over to SQL Server.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,276
Messages
6,171,139
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top