Very very slow startup of a xlsm spreadsheet

gray_b

New Member
Joined
Apr 17, 2019
Messages
34
Office Version
  1. 365
Platform
  1. Windows
I am looking for advice of what to do, as my xlsm spreadsheet takes 2 mins ( 120 secs ) to run.

365 Excel running on onedrive
There are 54 pages
No addins
All routines are in Thisworkbook
The first routine reads in data from a stored mdb file on onedrive using con.Provider = "Microsoft.ACE.OLEDB.12.0" ( 9000 lines of data, each of 90 records ) but only takes 3 secs

In running each routine, most are very fast. However there 2 nearly identical routines that take 30 secs and 22 secs, but in them there a lot of "For each sheet" If statements. So I can understand the time taken.

But where can I find what is gobbling up all the remaining time of 68 secs ??

Any advice or guidance
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Does it take the same amount of time on a different machine ??
 
Upvote 0
I'd suggest the isuue might be bringing the data from One Drive.
Have you tried saving the mdb to your local drive ?
 
Upvote 0
I have tried

VBA Code:
Application.ScreenUpdating = False
code
Application.ScreenUpdating = True

And strangley that increases the time to 140 secs
 
Upvote 0
I'd suggest the isuue might be bringing the data from One Drive.
Have you tried saving the mdb to your local drive ?

The code refers to the mdb file on my hard drive, but it is syn'd with ondrive

VBA Code:
con.ConnectionString = _
 "C:\Users\xxxxx\OneDrive\Access\my data.mdb"
 con.Provider = "Microsoft.ACE.OLEDB.12.0"
 con.Open
 
Upvote 0
I borrowed some code from

https://stackoverflow.com/questions/58799143/how-to-speed-up-the-following-excel-vba-code

VBA Code:
StartTime = Timer

    Application.ScreenUpdating = False
    Application.EnableEvents = False
    Application.AskToUpdateLinks = False
    Application.DisplayAlerts = False
    Application.Calculation = xlCalculationManual

'Your code

Application.ScreenUpdating = True
    Application.EnableEvents = True
    Application.AskToUpdateLinks = True
    Application.DisplayAlerts = True
    Application.Calculation = xlCalculationAutomatic
    ActiveWindow.View = xlNormalView

'------ END TIMER------
TimeTaken = Format((Timer - StartTime) / 86400, "hh:mm:ss")
MsgBox "Running time was " & TimeTaken & " (hours, minutes, seconds)"

That produces a time to 138 secs
 
Upvote 0
So not using any of the Microsoft go faster bits of code, my xlsm spreadsheet takes 2 mins ( 120 secs ) to run.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

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