File takes a long time to open...sometimes

u742884

Board Regular
Joined
Jun 23, 2002
Messages
126
I have a file with a ton of formulas so it takes a little while to open. However sometimes it takes a VERY long time to open. I have an auto_open sub:

Sub auto_open()
With Application
.Calculation = xlManual
End With
Splash.Show
AllLock
Application.Goto Reference:="VeryStart"
End Sub

Splash is a form with button that just kills the form.
AllLock is another sub:

ub AllLock()
Sheets("Start").Select
Range("A1").Select
LockSheet

Sheets("A").Select
Range("A1").Select
LockSheet

Sheets("B").Select
Range("A1").Select
LockSheet

Sheets("C").Select
Range("A1").Select
LockSheet

.
. Repeats until Sheets("K). A-J are identical; K has very little on it.
.

End Sub

When this all works properly, the file opens, calculates (that's the lengthy part), then you quickly see it run through the sheets as it locks them--2 seconds or so to finish all of them. Other times, you see it move painfully slow between each sheet--perhaps a minute on each one!

Related to this problem, sometimes when I just select one of the tabs, I have to sit and wait a while before being able to maneuver between the cells.

Anyone have any ideas? Maybe turning the windows off might help?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
What does LockSheet actually do?

What about turning off screen updating?
Code:
Sub AllLock()

    Application.ScreenUpdating = False
    
    Sheets("Start").Select
    Range("A1").Select
    LockSheet

    For I = Asc("A") To Asc("K")
        Sheets(Chr(I)).Select
        Range("A1").Select
        LockSheet
    Next I
    
    Application.ScreenUpdating = True
    
End Sub
 
Upvote 0
Locksheet is pretty inelegant:

Sub LockSheet()
ActiveSheet.Protect "mypassword"
End Sub

I will try the screen updating--can't hurt.

Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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