Import Excel data to an MS Access Table too slow!

Pau905

New Member
Joined
Nov 10, 2020
Messages
16
Office Version
  1. 365
Hi Member,

I got the code below to import data from excel to an MS Access table. The code works but is very very slow. It takes over 1.5 minute to import the data. Number of rows in the excel data file is 120000 and number of colums are 110. How can I make this faster?

//Paul

Dim objAccess As Object
Set objAccess = CreateObject("Access.Application")
objAccess.Visible = False
objAccess.OpenCurrentDatabase C:\TEMP\TEST.accdb, Exclusive:=True
objAccess.DoCmd.TransferSpreadsheet acImport, 10, "TEST", Environ("temp") & "\TEST.xlsx", True
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I got the code below to import data from excel to an MS Access table. The code works but is very very slow. It takes over 1.5 minute to import the data. Number of rows in the excel data file is 120000 and number of colums are 110. How can I make this faster?
For the size of your data, that doesn't sound unreasonable.
However, have you considered simply linking your Excel data to an Access table instead of physically importing it?
That would bypass the need to import, though it may affect database performance.
If you do import it, be sure to apply indexes and primary keys to your table to maximize performance.
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,219
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top