Disable "Save" and "Save As" functionality in all windows versions of excel
Hi our company has a file in which we would like to upload to sharepoint. We don't want the end user to be able to save or save as. I tried to do Alt F11 and put this code in "This Notebook" but some users were still able to save.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then
Cancel = True
MsgBox "SaveAs is Disabled", vbOKOnly
End If
End Sub
The users will have 2003, 2007 or 2010 Excel.
How do we get around the people who do not have macros enabled?
Thank you,
T
Re: Disable "Save" and "Save As" functionality in all windows versions of excel
The below macro will disable the Save As feature in excel. This means that a user will not be able to resave the workbook under a different name or even in a different location. The only option for saving is to click "Save" which will only save any changes made to the current document.
Code:
Private Sub Workbook_BeforeSave (ByVal SaveAsUI As Boolean, Cancel As Boolean)
'This macro disables the "Save As" Feature in Excel
'This means that a user will not be able to save this
'workbook(file) under a different name or in a different location
'
'This MUST be placed in "ThisWorkbook" and NOT in a Module.
'
If SaveAsUI = True Then Cancel = True
End Sub
Re: Disable "Save" and "Save As" functionality in all windows versions of excel
Thanks Einstein, what happens if a user doesnt have their macros enabled?
Thanks!
T
Re: Disable "Save" and "Save As" functionality in all windows versions of excel
Hi.
I have disabled the SaveAs function in an Excel 2007 protected workbook. This is working well. (Thank you all for helping with the code.)
How do I now disable the automatic Microsoft Office Excel message box reminder to save changes? This is unnecessary and confusing since users cannot save the workbook. AND I have programed a Message Box reminder when they try.