Disables the "Save As" Feature in Excel

Add to Favorites
Author:
This 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.

Where to install the macro:  ThisWorkbook

Excel Macro to Disable the Save As feature in Excel

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






Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Similar Content on TeachExcel
Filter Data to Show Only the Bottom 10 Items in Excel - AutoFilter
Macro: This Excel macro filters a selection of data in order to display only the bottom 10 items ...
Require a Unique List of Numbers in a Range in Excel
Tutorial: I'll show you how to require a user to enter a unique number into a range of cells in Exce...
Scale Data for Printing in Excel - Fit more onto a Printed Page
Tutorial: This tip shows you how to fit more Excel data onto a page for printing. This does not chan...
Add a Drop Down Menu to a Cell in Excel - Data Validation Macro
Macro: Add a drop down menu or list to a cell in Excel with this free Excel macro. This is a grea...
Format Cells as Text in Excel
Macro: This free Excel macro formats a selection of cells as Text in Excel. This macro applies th...
Create a 12 Month Calendar With The Current Day Highlighted in Excel
Macro: Create a 12 month formatted calendar on a new tab in Excel with the current day highlighte...


How to Install the Macro
  1. Select and copy the text from within the grey box above.

  2. Open the Microsoft Excel file in which you would like the Macro to function.

  3. Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.  Or For other ways to get there, Click Here.

  4. On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.

  5. If the Macro goes in a Module, Click Here, otherwise continue to Step 8.

  6. If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.

  7. If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.

  8. Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.

  9. You are now ready to run the macro.

Tutorial Details
Similar Content
Filter Data to Show Only the Bottom 10 Items in Excel - AutoFilter
Macro: This Excel macro filters a selection of data in order to display only the bottom 10 items ...
Require a Unique List of Numbers in a Range in Excel
Tutorial: I'll show you how to require a user to enter a unique number into a range of cells in Exce...
Scale Data for Printing in Excel - Fit more onto a Printed Page
Tutorial: This tip shows you how to fit more Excel data onto a page for printing. This does not chan...
Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course