ACC2000: "Could Not Find Object" Error Importing MS Excel FileID: Q209924
|
When you try to import or link a Microsoft Excel spreadsheet, if you click Show Named Ranges in the Import Spreadsheet Wizard or the Link Spreadsheet Wizard, you may receive the following error message:
You may also receive this error if you use a macro or a Visual Basic for Applications procedure to import or link the spreadsheet.The Microsoft Jet database engine could not find the object '<name of selected range>'. Make sure the object exists and that you spell its name and the path name correctly.
DoCmd.TransferSpreadsheet acExport, 8, "MyTable", "C:\MyFile.xls", True, "MySheet!MyRange"
The named range you selected in the Import Spreadsheet Wizard or the Link Spreadsheet Wizard is longer than 64 characters. Although Excel allows a name of up to 255 characters, the Microsoft Excel ISAM driver
that Access uses to import or link spreadsheets truncates a range name to 64 characters. The import or link fails because Access cannot find the truncated range name in the spreadsheet.
The reason for the 64-character truncation is that Access uses the name of the range as the table name in your database, and table names are limited to 64 characters.
There are two ways to work around this behavior.
Function ImpByAddress()
Docmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"test", "c:\My Documents\Book1.xls", , "A1:E32"
End Function
You_can_access_the_Microsoft_Knowledge_Base_from_the_Microsoft_Web_siteClick OK.
Access_the_Microsoft_Knowledge_Base_from_the_Microsoft_Web_siteClick OK.
You_can_access_the_Microsoft_Knowledge_Base_from_the_Microsoft_Web_siteNote that you receive the error message described in the "Symptoms" section of this article.
Access_the_Microsoft_Knowledge_Base_from_the_Microsoft_web_siteNote that the error does not occur because the second selection is a named range that has fewer than 64 characters.
In Access:
For more information about Access table specifications, click Microsoft Access Help on the
Help menu, type "table specifications" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
For more information about the TransferSpreadsheet method, click Microsoft Access Help on the
Help menu, type "TransferSpreadsheet method" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
For more information about the TransferSpreadsheet action, click Microsoft Access Help on the
Help menu, type "TransferSpreadsheet action" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
In Excel:
For more information about range names, click Microsoft Excel Help on the
Help menu, type "naming, ranges" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
Additional query words: xl xls attach prb
Keywords : kbinterop kbdta IsmExl5
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 13, 1999