Importing Excel tabs in Access

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

Guest

Hi - I have a excel spreadsheet with 10 tabs and i would like to import only
2 of them which are randomly placed.

I would like to know how to import the specific tabs using the code

docmd.transferspreadsheet

Thanks for all the help.
 
Put the name of the spreadsheet tab in the Range argument of the
TransferSpreadsheet method.
 
I tried this, it is still importing the first tab.


DoCmd.TransferSpreadsheet acImport, , "tbl_West_ESPN", S:\File
Management\Automation\Autofall\PS1_WEST.xls, ,ESPN2

Is there anyting wrong with the above code?
 
It needs to be in quotes.
DoCmd.TransferSpreadsheet acImport, , "tbl_West_ESPN", S:\File
Management\Automation\Autofall\PS1_WEST.xls, ,"ESPN2"
 
When i run this with quotes, i have a run time error:
"The microsoft jet database could not find the object"

Here is the updated code:

DoCmd.TransferSpreadsheet acImport, , "tbl_West_ESPN", PathStr &
"PS1_WEST.xls", , "ESPN2"


Please advice. Thanks

:
 
Check the spreadsheet to be sure a sheet with the name ESPN2 exists and that
there are no leading or trailing spaces in it.
Also, you have it coded so that the spreadsheet has no field names in the
first row. Is that what you want?
 
Still same error!!. I even changed the name of the tab, but still no luck.

I do not have field name in the firstrow, so i have left it blank.

any other ideas.
Thanks for your patience.
 
Back
Top