Solved

Transfer data from excel to Acess using access VBA

Posted on 2014-02-03
4
1,670 Views
Last Modified: 2014-02-05
What do you think is the most eficient way to export data from excel into access.
We have very large excel file with about 0.5 Millions records , I need to transfer it into access table.

I have a way to do it, but it is VERY slow.  I did a procedure where i first do a linktable to excel file and then i run append query. It take very long time to run. Any other more efficient way to do it?
0
Comment
Question by:maximyshka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 30

Expert Comment

by:gowflow
ID: 39830828
It can be done the other way around have a macro in VB that export data to the access table however this need to be tested as do not know the time frame of execution when it comes to 05 million record. How many fields you have there ?
gowflow
0
 
LVL 25

Accepted Solution

by:
chaau earned 500 total points
ID: 39830830
I think DoCmd.TransferSpreadsheet should be the fastest:
Dim strXls As String
strXls = "c:\Temp\temp.xls"
DoCmd.TransferSpreadsheet acImport, , "tblExcel", strXls, True, "temp!"

Open in new window

After the import data will be in the table called "tblExcel". You can then run your Append query. Alternatively, you can call DoCmd.TransferSpreadsheet to import directly into your existing table
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39831633
it is VERY slow

1. What actual times are you observing?
2. How big is the Excel workbook?
3. How big is the Excel worksheet?
4. Have you compacted your database recently?
5. How much free RAM (physical memory) do you have when you do the import?
6. Are you importing to an empty table or appending to an existing table?
7. Does the Access table have any indexes?
8. What does your Append query look like?
9. What does your VBA code look like?
10. Are the workbook and database on your local hard drive?
0
 

Author Closing Comment

by:maximyshka
ID: 39835802
This is what seems to be woring the best
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question