DoCmd.TransferSpreadsheet not working with named Range

M

Margi

I want to import the same range from multiple worksheets in a workbook into
Access tables. I can get the local range to import just fine, using either a
literal or a variable, so long as I use cell notation: eg,
DoCmd.TransferSpreadsheet acImport acSpreadsheetTypeExcel97,
"tblTempXLProjects", _
szPath, False, "116!C2:AP10"
or a variable whose value is set to 116!C2:AP10.

When I substitute XLProjects (the named range) in either the literal or the
variable, it doesn't work. I've tried using !, :, $, etc.

I'm using MS Access 2002 in an Access 2000 DB.

Any help would be appreciated. I have thought of using other object
language to get the cell values for the ranges, but if I can do this taking
advantage of the simplicity of TransferSpreadsheet, it would simplify things.

Thanks!
 
M

Margi

Sorry. The title of the group is Developer VBA, which I thought described
what I was doing pretty well. I should have known - you can find anything
in/about Microsoft if you already know where it is!
 

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