OzGrid

Prevent Save As in Excel

< Back to Search results

 Category: [Excel]  Demo Available 

Prevent Save As in Excel

 

Stop Workbook Being Saved With Another Name & Path

 

Got any Excel/VBA Questions? Free Excel Help

Preventing a Workbook From Being Saved as Another Name.

The code below can be used to stop any users saving a Workbook as another name and another location. The code must be placed in the Private Module of the Workbook Object (ThisWorkbook). The fastest way to get there is to right click on the Excel icon, top left next to File and select View Code. It is in here you should place the code below and then save the Workbook. So long as the Workbook is opened with macros enabled the code will fire anytime any user tries to use Save As.

Private Sub Workbook_BeforeSave _

               (ByVal SaveAsUI As Boolean, Cancel As Boolean)

	If SaveAsUI = True Then Cancel = True

End Sub

See also:

Prevent Excel Being Saved With Another Name
Prevent Save Prompts in Excel

 

See also Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions.

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.


Gallery



stars (0 Reviews)