How to stop getting the file save box when running a macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am running a macro that take a few minutes. Half way through I get a box
saving do you want to save the file whith the normal 'Skip, Cancel' options.

How can I stop getting this whilst the macro is running?

Thanks
 
It sounds as if Autosave is kicking in. You would need to turn it off while
your code is running. Here are some routines I wrote a long time ago for
that purpose. I hope they work with your Excel version these days but,
fwiw...

Sub DisableAutosave()
ToggleAutoSave False
End Sub

Sub EnableAutosave()
ToggleAutoSave True
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

--
Jim
|I am running a macro that take a few minutes. Half way through I get a box
| saving do you want to save the file whith the normal 'Skip, Cancel'
options.
|
| How can I stop getting this whilst the macro is running?
|
| Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top