Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TransferSpreadsheet help please ...

Status
Not open for further replies.

solo7

Technical User
Mar 14, 2001
243
NO
I am importing a spreadsheet useing the following code :-

Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "TblTemp", StrXlsAddress, True, StrXlsSheet

where StrXlsAddress is a string holding the address of the spreadsheet, and StrXlsSheet is the name of a specific worksheet within that spreadsheet.
It's giving me an error which says it cannot find the object which relates to the name of the individual sheet within the spreadsheet.

Anyone have any clues please?

solo7 [thumbsup2]
 
My Access 2000 database produced this:

DoCmd.TransferSpreadsheet acImport, 8, "tblTemp", "mySpreadsheet.xls", True, "myRange"

The last value, "myRange", denotes a named range in the spreadsheet, NOT a sheet name. Try creating a named range in your sheet, then use that name in your VBA.
 
Named ranges would be nice, but I have a large number of old spreadsheets to import. I really would like to use the name of the spreadsheet 'sheet' if I could ...

solo7 [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top