472,802 Members | 1,448 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,802 software developers and data experts.

Importing Excel into Access

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
2 2599
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for...
9
by: Edward S | last post by:
I budget for a Project in an Excel sheet as illustrated below. The months below are usually a 2 year period i.e. 24 months, though it could be over 24 months depending upon a Project. I then...
7
by: Darren | last post by:
I have been attempting to create a reservation planning form in excel that imports Data from an Access database and inserts that information automaticly into the correct spreed sheet and the...
2
by: nutthatch | last post by:
I want to be able to import an Excel spreadsheet into Access 2K using the macro command Transferspreadsheet. However, the file I am importing (over which I have no control) contains some records...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
1
by: Geoff Jones | last post by:
Hi I have a question which I hope somebody can answer. I have written a VB application with which I want to import an Excel file, analyze the data within it and do some calculations. There are...
1
by: winzy | last post by:
I have a table in Access which needs updating from an Excel file. Instead of importing the whole Excel like a new table in Acess, how do I do a partial import/update?? For example, Access table...
5
by: hharriel | last post by:
Hi, I am hoping someone can help me with an issue I am having with excel and ms access. I have collected data (which are in individual excel files) from 49 different school districts. All...
3
by: mukeshsrivastav | last post by:
dear sir i want to move form excel to access. i have 5 excel file having same formats and fields.now i want to import all data in one access table. importing one file is easy .but importing and...
28
by: kkadakia | last post by:
I get a daily excel file for a entire month which I want to transfer into Access at the end of the month. So, there are around 20-25 excel files I get by the end of the month, and I would like to...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.