How to import a worksheet into Access?

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

Guest

Hi all,

I am trying to use DoCmd.Transferspreadsheet to import a worksheet tab, but
I am sure the syntax. I tried looking at the online help and msdn's online
help. It only gave an example on a Lotus spreadsheet. Can you share with
me how it is done? Thanks in advance.

Ben


--
 
Hi all,

I am trying to use DoCmd.Transferspreadsheet to import a worksheet tab, but
I am sure the syntax. I tried looking at the online help and msdn's online
help. It only gave an example on a Lotus spreadsheet. Can you share with
me how it is done? Thanks in advance.

Ben

The following will import a specific worksheet (MyDataQuery) and range
of cells (K1:K3) from the "frmEntry.xls" spreadsheet.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
"MyImportTable", "c:\My Household\frmEntry.xls", False,
"MyDataQuery!K1:K3"

See VBA help on the TransferSpreadsheet method for more information
regarding the arguments used.
 
Back
Top