473,385 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2623
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.