Importing Excel Data from Multiple Files with Multiple Sheets

R

Rafael Bradley

I am having trouble getting "TransferSpreadsheet" to work in a module
that I am writing. When I test it with a string variable containing the
range and worksheet name I keep getting an error message that the range
does not exist. (I also get the same error when I use a string literal.)

The name of the range that contains the data I want to import is 'Section
1'!A2:C100.
(Note that the cells in range B1:C1 are merged in the Excel file.)

What happens is that MS Access converts the "!" in my range into a dollar
sign ("$") and the import fails to find the range. The range as MS Access
sees it is 'Section 1'$A1:C100.

I have over 100 workbooks to import data from. All have the same six
worksheets named: 'Directions', 'Section 1','Section 2', ...,'Section 5'.
I need the data from the same range in each of the last 5 sheets in each
workbook.

QUESTION: Why is MS Access converting the "!" to a "$" in my range string?

When I import using the IMPORT dialog, everything is imported
properly. If anyone can recommend a solution, please send me an email.


Thanks in advance,
Rafael
(e-mail address removed)
(e-mail address removed)

PC System:
Dell Dimension PC
Windows 2000 Pro, SP-3 installed
MS Access 2002, SP-2 installed
 

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