Import Excel named range into Access

T

TJ Dowling

I'm having trouble importing an Excel named range into Access with VBA. I'm
using MS Office 2003. The table name is "xls_Link". I have created a named
range called "Import" in the file ImportFile.xls and am using this code:

Docmd.Transferspreadsheet acImport, acSpreadsheetTypeExcel5, "xls_Link",
"ImportFile.xls", True, "Import"

I get an error #3011 that says the MS Jet db engine could not find the
object "Import". It works fine if I manually import the table but I need to
automate it since it changes often. I've also tried linking with the same
result.

Any ideas how to fix it?

Thanks,
TJD
 
K

Ken Snell \(MVP\)

Allen, that information is for the Range argument when exporting, not
importing < s >. I am going to have to add this type of info to that page.

TJ, try this as the Range argument in your TransferSpreadsheet step:

"Import$"
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top