Auto Save

  • Thread starter Thread starter Ray Batig
  • Start date Start date
R

Ray Batig

I am running some very long macros which get interrupted by auto save which
I have enabled. Is there a way to disable auto save from within the macro
and then re-enable it before exiting the macro? Since I share macros with
others at work, I probably should check to see if auto save is enabled
first.

Thanks in advance for your help!

Ray
 
Ray,

AddIns("AutoSave").Installed = False
....
Do Stuff
....
AddIns("AutoSave").Installed = True


It's untested.. Please let me know if this works?

Rob
 
Seems like the below code will work with Excel97, but don't think it will
work with Version 2002 or greater. If you're running the more recent
versions, I think you will need to use the following.

application.autorecover.enabled=false
do stuff
application.autorecover.enabled=true

If however, you'd like to check the status of the users autorecover so you
can leave it in the same status as the user had been running, then try this.

'create variable
dim strAutoRecover as string

'assign value for variable
strAutoRecover=application.autorecover.enabled

application.autorecover.enabled=false 'insure AutoRecover _
is disabled.

do stuff

application.autorecover.enabled=strAutoRecover 'set AutoRecover _
back the way user had it.

Let me know if this helped.

D.S.
 
Hi Rob,

After building a test sheet with the VBA code, I tried to stop AutoSave and
got a subscript out of range error. I will keep trying.

Thanks
 
Sometimes it's easier to search google:

I found this post by Jim Rech:
http://groups.google.com/groups?threadm=#rFHna42$GA.197@cppssbbsa04

Oh, heck. It's pretty short:

Assuming your question is, given that the Autosave add-in is open how do I
programmatically enable and disable it, there is nothing documented on that
as far as I know. The following are some macros that I hacked out several
years ago that seem to do the job. Fwiw:

Sub EnableAutosave()
ToggleAutoSave True
End Sub

Sub DisableAutosave()
ToggleAutoSave False
End Sub

Sub ToggleAutoSave(Setting As Boolean)
Workbooks("autosave.xla").Excel4IntlMacroSheets("Loc Table") _
.Range("ud01n.Do_Save").Value = Setting
Run "autosave.xla!mcs05.ClearOnTime"
Run "autosave.xla!mcs03.SetOnTime"
Run "autosave.xla!mcs01.CheckCommand"
End Sub
 
Thanks very much. Works.

Dave Peterson said:
Sometimes it's easier to search google:

I found this post by Jim Rech:
http://groups.google.com/groups?threadm=#rFHna42$GA.197@cppssbbsa04

Oh, heck. It's pretty short:

Assuming your question is, given that the Autosave add-in is open how do I
programmatically enable and disable it, there is nothing documented on that
as far as I know. The following are some macros that I hacked out several
years ago that seem to do the job. Fwiw:

Sub EnableAutosave()
ToggleAutoSave True
End Sub

Sub DisableAutosave()
ToggleAutoSave False
End Sub

Sub ToggleAutoSave(Setting As Boolean)
Workbooks("autosave.xla").Excel4IntlMacroSheets("Loc Table") _
.Range("ud01n.Do_Save").Value = Setting
Run "autosave.xla!mcs05.ClearOnTime"
Run "autosave.xla!mcs03.SetOnTime"
Run "autosave.xla!mcs01.CheckCommand"
End Sub
 
Back
Top