Auto Save question

dfsobral

Board Regular
Joined
Oct 19, 2015
Messages
141
hy

i'm presently working in a code that takes a few minutes to run, can go easily to 20/30 minutes depending on what the user wants

i already disable cancel key so the user may not stop the completion of the code but a potencial problem come to mind

what if the user force a crash of excel because assumed it was no longer running?

is it possible that excel autosave the file between the time the code starts and the crash occur?

because in this case the recovered file would be a bad one

is there a command that i could use to disable autosave in the beginning of the program and enable it at the end?

thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
First you might want to try this code to optimize your macro:

Code:
'Display wait for a moment
Application.StatusBar = "****Please Wait*****  Macro processing"
'opitmize macro by disabling all processes that slow it down.
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False






'Re-enable screenupdating (before END SUB)
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.AskToUpdateLinks = true
Application.StatusBar = False

You can disable and enable auto save this way:

Code:
Application.AutoRecover.Enabled = False 'disable
Application.AutoRecover.Enabled = True 'enable
 
Upvote 0
thanks

usually don't use
Application.StatusBar
Application.AskToUpdateLinks

will add it, everything that can make it run faster is good
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,098
Members
449,205
Latest member
ralemanygarcia

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