
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Disable Workbook Save and Allow Save As in Excel
Excel is a powerful tool for managing and analysing data, and sometimes you may want to restrict users from saving changes to a particular workbook to maintain data integrity or prevent accidental modifications. However, you might still want to allow users to create copies of the workbook using the "Save As" feature for their own use or further analysis.
In this tutorial, we will explore different methods to achieve this goal in Excel. We will cover both manual techniques and VBA (Visual Basic for Applications) solutions to disable workbook saving and restrict users to the "Save As" option only. Whether you are a beginner or an advanced Excel user, this tutorial will provide you with step?by?step instructions and examples to help you implement this functionality in your workbooks. By the end of this tutorial, you will have a clear understanding of the various approaches available and be able to choose the method that best suits your specific needs. So, let's get started and learn how to disable workbook save but only allow "Save As" in Excel!
Disable Workbook Save But Only Allow Save As
Here we will first add the VBA code to the whole workbook, then save the sheet to complete the task. So let us see a simple process to know how you can disable workbook save but only allow save as in Excel.
Step 1
Consider any Excel sheet. First, right?click on the sheet name and select "View Code" to open a VBA application. Then, double?click on this workbook and copy the below code into the text box, similar to the below image.
Code
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Not SaveAsUI Then Cancel = True MsgBox "You cannot save this workbook. Use Save As", vbInformation, "Disable workbook savel" End If End Sub
Step 2
Then close the VBA application using the command Alt + Q. From now on, when we try to directly save the sheet, it will return an error.
Conclusion
In this tutorial, we have used a simple example to demonstrate how you can disable workbook save but only allow save as in Excel to highlight a particular set of data.