Disable Autosave via Code

G

Guest

How can I disable Excel's Autosave programaticaly? With code that I can put
in the spreadsheet whenever it is opened? I don't want to have to turn it
off via Excel as this is too much of a problem for the 10 users that touch
the spreadsheet. We are running Excel on several citrix servers and it's too
much work to turn it off everytime a user open's Excel.


Thanks,

John
 
G

Guest

You can place this in the Workbook module to uninstall on open and reinstall
before close.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

AddIns("Autosave Add-in").Installed = True

End Sub

Private Sub Workbook_Open()

AddIns("Autosave Add-in").Installed = False

End Sub
 
D

Dave Peterson

Jim Rech posted this:

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
 

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

Top