Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading a sheet from an excel file

Status
Not open for further replies.

legos

Programmer
Jul 2, 2003
151
US
I have about 50 to 100 excel files. Each file has about 20 sheets on it. I want to write a script that will bulk load the information on the sheet with the name survey_point into a table in access.
I already know how to read info from text files, but i've never done linking between access and excel in a bulk manner such as this.
The excel sheet has values in collums A-K and an unknown amount of rows.
I would think it would work something like this. any help would be apreciated.
With Application.FileSearch
.NewSearch
.LookIn = "C:\wcs\updatemerge\"
.filename = "*.xls"
.Execute msoSortByFileName
If .foundfiles.count > 0 Then
For i = 1 To .foundfiles.count
Set fs1 = CreateObject("Scripting.FileSystemObject")
Set f = fs1.openExcelFile(.foundfiles(i), survey_point, ForReading)
'insert commands here
next i

Durible Outer Casing to Prevent Fall-Apart
 
Take a look at the DoCmd.TransferSpreadsheet method instead of the fso.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top