rpreiss
asked on
Access VBA Import table
I have a macro that is currently in an Excel Module that reformats excel sheets so they are importable into access. How would I write code in access that will run the procedures that are currently in the excel module to reorganize the tables, but also import them into seperate tables for each sheet in the workbook?
Thanks,
Artie
Thanks,
Artie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Artie,
Go to the VB Editor, and do a search on TransferSpreadsheet in the Help.
Go to the VB Editor, and do a search on TransferSpreadsheet in the Help.
eg below, replace names accordingly
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "AccessTableName", "c:\excelfile.xls", True 'true for has field names
put it inside your loop through your worksheets etc
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "AccessTableName", "c:\excelfile.xls", True 'true for has field names
put it inside your loop through your worksheets etc
ASKER
How would I construct this loop to go through all of the sheets in the workbook? I am new to VBA.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
ASKER
Thanks,
Artie