ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable Autosave via Code (https://www.excelbanter.com/excel-programming/353822-disable-autosave-via-code.html)

John Daily

Disable Autosave via Code
 
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

Kevin B

Disable Autosave via Code
 
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

--
Kevin Backmann


"John Daily" wrote:

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


Dave Peterson

Disable Autosave via Code
 
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("L oc Table") _
.Range("ud01n.Do_Save").Value = Setting
Run "autosave.xla!mcs05.ClearOnTime"
Run "autosave.xla!mcs03.SetOnTime"
Run "autosave.xla!mcs01.CheckCommand"
End Sub



John Daily wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com