By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,480 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,480 IT Pros & Developers. It's quick & easy.

Importing Excel into Access

P: n/a
I am having difficulting importing an Excel spreadsheet into my Access
program using VBA
I want to use the last argument to specify the worksheet name which is RTA.
I get an error which
says that the name worksheet or path is incorrect. However, if I "rem" out
the last parameter and make RTA
the 1st sheet in the Excel workbook, everything is imported correctly.
Unfortunately, I have several
worksheets in the workbook which need to be imported and thus the last
parameter is crucial.

DoCmd.TransferSpreadsheet acImport, , "RTAccess", "C:\ProminentPlacement\ASL
Report July 04.xls", True, "RTA"
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I'm just guessing here but have you tried writing the import as follows:

DoCmd.TransferSpreadsheet acImport, , "RTAccess", "C:\ProminentPlacement\ASL
Report July 04.xls!RTA", True

It might work if you can specify the worksheet in the file path rather than
as an extra parameter at the end.

"Bill Agee" <ws**@mindspring.com> wrote in message
news:ng*****************@newsread3.news.atl.earthl ink.net...
I am having difficulting importing an Excel spreadsheet into my Access
program using VBA
I want to use the last argument to specify the worksheet name which is RTA. I get an error which
says that the name worksheet or path is incorrect. However, if I "rem" out the last parameter and make RTA
the 1st sheet in the Excel workbook, everything is imported correctly.
Unfortunately, I have several
worksheets in the workbook which need to be imported and thus the last
parameter is crucial.

DoCmd.TransferSpreadsheet acImport, , "RTAccess", "C:\ProminentPlacement\ASL Report July 04.xls", True, "RTA"

Nov 13 '05 #2

P: n/a
Bill,

Give the worksheet a Range Name of RTA and then use your code as is with
"RTA" at the end.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Bill Agee" <ws**@mindspring.com> wrote in message
news:ng*****************@newsread3.news.atl.earthl ink.net...
I am having difficulting importing an Excel spreadsheet into my Access
program using VBA
I want to use the last argument to specify the worksheet name which is RTA. I get an error which
says that the name worksheet or path is incorrect. However, if I "rem" out the last parameter and make RTA
the 1st sheet in the Excel workbook, everything is imported correctly.
Unfortunately, I have several
worksheets in the workbook which need to be imported and thus the last
parameter is crucial.

DoCmd.TransferSpreadsheet acImport, , "RTAccess", "C:\ProminentPlacement\ASL Report July 04.xls", True, "RTA"

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.