Disable Save As Function
Sometimes you wish to send a copy of your unfinished Excel spreadsheet only for review or for other reasons, it is logical to turn off some of its features. In this tutorial we will try to explain how to do disable the 'Save As' function of Excel using Visual Basic Applications (VBA).

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.


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

About Us
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.
Contact Us
Follow Us
© Copyright 2023 Excelcrib | Privacy Policy