macro for importing table?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to use a macro to import a table from Excel. Coulf anyone advise
a good strategy?
 
Allen_N said:
I would like to use a macro to import a table from Excel. Coulf anyone advise
a good strategy?
Try to steer clear of macros. VBA is much the way to go. Try this.

Dim strPathName As String

strPathName = "PathName.XLS"


DoCmd.TransferSpreadsheet acImport, 8, "ZZ", strPathName, False, ""
 
Okay, now it gets curly: my workbook has more than 1 sheet (because the data
exceeded 65,536 records), and the TransferSpreadsheet action only imports the
1st one.

I have written an ActiveX routine to pass the number of sheets in the
workbook to my Access VBA routine, but all I can think of to do at the moment
is to warn the user that sheets after the 1st one must be imported manually.
Is there a way to automate this?
 
Back
Top