Hi All,
I'm trying to import an Excel sheet, but with more the one rang, couse the columns aint sequence.
for example:
DoCmd.TransferSpreadsheet acImport, , "DailyRprzntvRpt", _
Application.CurrentProject.Path & "\DailyRprzntvRpt.xls", True, "(A1:C18, F1:J18)"
I'm getting an error, that saies that the range is not recognized by Access.
Any idea?
2 7962 @amir369
I'm not 100% sure on this one, but I think you can only perform the Import on a single, specified Range as in: - DoCmd.TransferSpreadsheet acImport, , "DailyRprzntvRpt", _
-
Application.CurrentProject.Path & "\DailyRprzntvRpt.xls", True, "A1:C18"
ADezii is spot-on - you cannot use a split range with TransferSpreadsheet under any circumstances. If you look up the the help information for the TransferSpreadsheet action it is clear about what a range is:
Range
The range of cells to import or link. Leave this argument blank to import or link the entire spreadsheet. You can type the name of a range in the spreadsheet or specify the range of cells to import or link, such as A1:E25 (note that the A1..E25 syntax does not work in Access 97 or later). If you are importing from or linking to an Excel version 5.0 or later spreadsheet, you can prefix the range with the name of the worksheet and an exclamation point; for example, Budget!A1:C7. Note When you export to a spreadsheet, you must leave this argument blank. If you enter a range, the export will fail.
Why not just import all columns and ignore the additional columns D and E imported into your table? You are not obliged to refer to them in whatever subsequent queries you use on your Excel-imported data if you do not need to.
-Stewart
Sign in to post your reply or Sign up for a free account.
Similar topics
by: mcnewsxp |
last post by:
how can i specify a particular worksheet using the docmd
transferspreadsheet?
thanks,
mcnewsxp
|
by: Bill Agee |
last post by:
How do you specify a specific worksheet? I know this works if the worksheet
in question is the 1st, but suppose
I am interested in importing several worksheets from the same workbook.
There does...
|
by: user_5701 |
last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of
code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000,
"tblTest", pathAndFilename, True
The above line...
|
by: deko |
last post by:
I use a complied query to export to Excel like this:
SELECT * INTO .
FROM tblExcelData;
But I have a situation where I need to export several tables into the same
worksheet. The idea is to...
|
by: aleksandra_83 |
last post by:
Hello,
I have searched all over google groups and internet, but I have not
found a solution to this problem that has worked. The solutions I found
helped me single out the line that is causing...
|
by: sranilp |
last post by:
Hey All,
Actually I need to export the data from Access to Excel particular spreadsheet(ie.Raw Data),so I was using Docmd.Transferspreadsheet but in this syntax where i can give the spreadsheet...
|
by: jerelp |
last post by:
I have a form with one button the code for that button is
On Error Resume Next
DoCmd.TransferSpreadsheet acImport, 8, "FuelConsumption NewData", Me.tb_FileName, 1, "sheet2$"
On Error Resume...
|
by: blammo04 |
last post by:
My problem is that Access freezes up whenever I try to use the docmd.transferspreadsheet method, I can use the docmd.outputto and it works fine but I need to be able to use the transferspreadsheet...
|
by: Van Fitz |
last post by:
I am importing an excel worksheet into an existing access 2000 table using TransferSpreadsheet. Im using a timestamp field as well in this table. This is going well, however, once the data is...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |