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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Excel range error

Status
Not open for further replies.

EZEason

Programmer
Dec 11, 2000
213
US
I'm trying to import an Excel spreadsheet into Access 2002. There is only one worksheet that I need. Here is my code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "XLS_" & MarketName, strInputFileName, True, "ACID!"

If I take out the range argument it works fine, but does not import the correct sheet. Once I add the "ACID!" into the range I get the following error: "The Search Key Was Not Found In Any Record". Anyone have any ideas on what is going on???

What doesn't kill you makes you stronger.
 
You're not defining the cell range to import with "ACID!", try, e.g. "ACID!A1:Z100" or a named range.

TomCologne



 
Ever if I define a cell range as "ACID!A1:Z100" I get the same error. Beside you do not need to post a cell range if you are import the whole sheet. I've used it many times before with no problems in Access 2000.

What doesn't kill you makes you stronger.
 
I think I found the problem. The first field (A) in the worksheet is blank. If I import a different field it works fine.

What doesn't kill you makes you stronger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top