Greetings!
I am relatively new to coding and would like some help with the following problem.
I want to create a loop that will utilize the "Transfer Spreadsheet" method to import data from multiple excel files in one directory to tables in my database.
The main problem is allowing importing multiple files in the same directory with the same extension (.xls) How does one allow for a "wildcard" in the Transfer Spreadsheet method so that multiple, unspecified files can be imported?
Here is some code that I started but am bogged down with:
Dim Path, FileName
FileName = Dir("C:\My Documents\Programs and Facilities\FCCC\TestData\*.xls")
DoCmd.TransferSpreadsheet acImport, 8, "DataTransfer-Groups", "C:\My Documents\Programs and Facilities\TestData\ FileName (Variable)", True, "DataTransfer-Groups!A1:G32"
Your help is much appreciated!!
I am relatively new to coding and would like some help with the following problem.
I want to create a loop that will utilize the "Transfer Spreadsheet" method to import data from multiple excel files in one directory to tables in my database.
The main problem is allowing importing multiple files in the same directory with the same extension (.xls) How does one allow for a "wildcard" in the Transfer Spreadsheet method so that multiple, unspecified files can be imported?
Here is some code that I started but am bogged down with:
Dim Path, FileName
FileName = Dir("C:\My Documents\Programs and Facilities\FCCC\TestData\*.xls")
DoCmd.TransferSpreadsheet acImport, 8, "DataTransfer-Groups", "C:\My Documents\Programs and Facilities\TestData\ FileName (Variable)", True, "DataTransfer-Groups!A1:G32"
Your help is much appreciated!!