Disable Save As Function
How is it done
The first step is to access the Visual Basic window via Developer > Visual Basic. A new window will come out and then double click "ThisWindow" in the project browser, this will bring a blank white page at the right side where we can paste the VBA code.
Copy and paste the following code in the blank page of the VBA window.
The message can be customized as the way you like it. The code uses the built-in syntax "ByVal SaveAsUI" to call a command when the 'Save As' function were called.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If SaveAsUI Then MsgBox "The 'Save As' function has been disabled." & _ Chr(10) & "For Review Purpose Only", vbInformation, "Save As Disabled" Cancel = True End If End Sub
Excelcrib was founded in November 2017 by Garry, a Microsoft® Office Excel® (MS Excel) enthusiast with background in engineering. He's been using MS Excel for more than 15 years in practice with specialty in VBA.