Protect Workbook in Excel (6 Ways)

In this article, you will learn how to protect a workbook in Excel. Throughout this article, we will discuss a total of 6 effective ways to protect a workbook in Excel. You can protect the whole workbook or specific cells using a password or without a password in Excel.

Sometimes, while working with Microsoft Excel, we must protect our dataset for the convenience of our work. For a confidential workbook, it must be password-protected so that no one can change it and it remains intact. Excel provides several simple methods for performing this. Depending on our needs, we can set various types of file protection. We hope you find this article informative and useful. So, let’s get into the main discussion.

Note: We used Microsoft 365 to prepare this article, but the operations apply to all versions. 

1- overview image of protect workbook in Excel


Download Practice Workbook

You can download the practice workbook from here:

The password for the file is- 12345.


What Does It Mean to Protect a Workbook in Excel?

The “Protect Workbook” feature in Excel prevents unauthorized modifications to the entire workbook. It protects not individual cells or worksheets of a workbook, but its structure and windows. By protecting the workbook, we can specify different editing restrictions.


How to Protect Workbook in Excel? (6 Effective Ways)

Excel has several ways to protect a workbook easily. We can set different kinds of protection in a file according to our requirements. In this article, we will discuss 6 effective ways to protect an Excel workbook.

1. Protect Excel Workbook by Using Mark as Final Option

We can protect an Excel worksheet from alteration by identifying a version as a final copy. So, when someone opens the Excel file, they will get a warning message saying that it’s the final version and they shouldn’t make any changes to it. Follow the below steps:

  • First, open the desired Excel file to “Mark As Final”.
  • Then, go to File>> Info>> Protect Workbook>> Mark as Final.

2- selecting mark as final option from protect workbook section

  • Then, a small dialog box will appear. Just hit OK.

3- clicking ok after selecting mark as final option to protect an Excel workbook

  • As a result, Excel will automatically mark the Excel workbook as a final version.
  • Excel will display the following warning box if someone else attempts to open the workbook.
  • Just hit OK to proceed.

4- clicking ok in the warning box to proceed further

  • If you want to continue editing the worksheet, just click Edit Anyway.
  • Excel will then allow you to edit the workbook.

5- clicking edit anyway to continue editing the worksheet

Thus we can protect an Excel workbook by using the “Mark as Final” option.


2. Protect Excel Workbook with a Password

In this method, we will protect our Excel workbook with a password so that others will not be able to access the data unless we provide them with the password. To do so follow the below steps:

  • First, go to File>> Info>> Protect Workbook>> Encrypt with Password.

6- selecting Encrypt with Password option from protect workbook section

  • Now, insert a password in the Encrypt Document dialog box and click OK.

7- entering password in the Encrypt Document dialog box

  • Then, re-enter the password in the Confirm Password dialog box and click OK.

8- re-entering password in the Confirm Password dialog box

  • Try opening your workbook again to see if the method worked.
  • A password prompt should automatically appear in Excel to enter the password to access data.
  • Enter password 12345 and click OK.

9- entering password to open password protected workbook in Excel

Thus, we can protect our Excel workbook with a password.


3. Use ‘Open as Read-Only’ Feature to Protect Workbook

We can mark our Excel workbook as a Read-Only file. Thus, when someone else attempts to open the Excel file, it will primarily protect the workbook from editing.

  • First, go to File>> Info>> Protect Workbook>> Always Open Read-Only.

10- selecting Always Open Read-Only option from protect workbook section

  • This will shift the Excel workbook to Read-Only mode and if someone else will try to open the Excel file, it will show the following dialog box.
  • Click Yes to proceed with the Read-Only mode whereas selecting No will enable editing the workbook.

11- selecting yes no from read only dialog box to protect workbook in Excel

Thus we can use the ‘Open as Read-Only’ feature to protect our workbook in Excel.


4. Use General Options to Protect Excel File with Password

There is another option in Excel by which we can set passwords to open a file and also to modify a file.

  • Click on the File tab.

12- selecting file tab to use general options to protect Excel file with password

  • Next, go to Save As>> Browse.

13- choosing browse option to use general options to protect Excel file with password

  • As a result, a dialog box named Save As will open up.
  • Now, click on Tools>> select General Options from the drop-down.

14- selecting general options under tools section

  • Now set a password to open the file.
  • After that, set another password to modify the file. We have entered 12345 in both fields.
  • Next, click OK.

15- entering passwords in the general options dialog box

  • Then, re-enter the password to proceed and click OK.

16- re-entering password to proceed

  • Now, re-type the password to modify the file and click OK.

17- re-type the password to modify the file

  • Now if we close the workbook and open it again, it will ask for the password.
  • Give the password to open the file.

18- giving password to open the Excel file

  • Next, it will ask for the password to modify.
  • Give the password and click OK.
  • Thus we can use general options to protect our Excel file with a password.

Read More: [Fixed!]: Protect Workbook in Excel Not Working


5. Protect Structure of an Excel Workbook

We can restrict others from deleting current sheets or adding new ones by protecting the structure of our workbook. To know how to protect the structure of an Excel workbook follow the below steps:

  • First, go to File>> Info>> Protect Workbook>> Protect Workbook Structure.

19- selecting Protect Workbook Structure option from protect workbook section

  • Now, enter the password in Protect Structure and Windows dialog box and click OK.

20- entering password in Protect Structure and Windows dialog box

  • Re-enter the password to confirm and proceed.

21- confirming password to protect structure of an Excel workbook

  • To verify, double-click on the name of the sheet you want to rename, and Excel will prompt you with the message below.

22- verifying after protecting structure of an Excel workbook

This is how we can protect the structure of our Excel workbook. By applying this method, anyone can open the Excel file, but cannot add a sheet, change the name, or delete any existing sheets.


6. VBA Code to Protect Excel Workbook with Password

In this method, we will protect the Excel workbook with a password using a VBA code. To know the procedures go through the following steps:

  • First, press ALT + F11 on your keyboard to open Visual Basic.
  • Then click Insert and select Module.
  • Insert the following code in the code editor and press F5 to run the entire code.

23- VBA code to protect Excel workbook with password

  • If you open the file again after running the VBA code successfully, you will need to enter the password.

24- entering password to access data after protecting Excel workbook with VBA

Thus, we can use VBA code to protect Excel the workbook with a password.

Read More: Difference Between Protect Sheet and Protect Workbook in MS Excel


How to Protect Specific Cells in an Excel Workbook

Suppose, we want to protect some specific cells. To do that, we need to protect the sheet. Follow the below steps to protect an Excel sheet from editing and copying specific cells:

  • First, select the cell range of the specific worksheet you want to protect.
  • In our case, we select column B of the SalesRecordOf2021 worksheet.
  • Then right-click on your mouse and select Format Cells.

25- selecting format cells to protect specific cells in the Excel workbook

  • Now go to Protection>> check the box next to the Locked option>> then click OK.

26- selecting locked option under protection tab

  • Now, go to the Review tab>> click on Protect Sheet.
  • Enter the password and enable “Protect worksheet and contents of locked cells”.
  • Click OK.

27- entering password and enabling Protect worksheet and contents of locked cells

  • Re-enter the password to confirm and click OK.

28- confirming password to protect specific cells in an Excel workbook

  • As a result, if you want to make any changes in column B, Excel will show you the warning message like in the image below.

29- showed warning message in case of trying to edit anything in column B

Thus you can protect specific cells in a workbook.


What Are the Benefits of Protecting Workbook in Excel?

Protecting a workbook in Excel offers several benefits, including:

  • Data Security: By protecting a workbook, we can ensure the privacy and accuracy of your data. Unauthorized users will not be able to access or modify the contents of worksheets or workbook elements that are protected.
  • Preventing Unintentional Changes: Workbook protection prevents accidental modifications to important formulas, data, and formatting. This is especially helpful when sharing the workbook with others, as it ensures the structure and functionality remain intact.
  • Presentation Purposes: Protecting a workbook is useful when we want to create a read-only version for presentations or demonstrations. It ensures that the data and formatting remain unchanged, preventing accidental modifications during the presentation.

What Are the Things You Need to Remember?

It is essential to keep a backup copy of the unprotected workbook in case we forget the password or lose the original workbook. Workbook protection should be used carefully, and we should keep a backup copy on hand at all times.


Key Takeaways from the Article

  • In this article, we have discussed a total of 6 effective ways to protect a workbook.
  • First, we have discussed what it means to protect a workbook.
  • We have also explained how to protect Excel workbooks using VBA macro.
  • Showed a step-by-step procedure of all methods.
  • Also showed how to protect specific cells in a workbook.
  • Discussed some benefits of protecting a workbook.
  • Mentioned a few points that should be remembered regarding protecting a workbook in Excel.
  • Provide solutions to frequently asked questions by readers.

Conclusion

This article covers every possible way to protect a workbook in Excel with some easy ways. Don’t forget to download the Practice file. We hope this was helpful. Please let us know in the comment section if you have any queries or suggestions.


Frequently Asked Questions

1. What is the difference between Protect Workbook in Excel and Protect Sheet?

Answer: The main difference between “Protect Workbook” and “Protect Sheet” in Excel lies in the scope of protection and the level of control over the workbook’s elements. Workbook protection focuses on protecting the overall structure and windows of the entire workbook, while worksheet protection is designed to protect individual worksheets within the workbook.

2. What happens when you protect a workbook?

Answer: When we protect the workbook, we can specify different editing restrictions. It protects not individual cells or worksheets of a workbook, but its structure and windows. For example, we can allow users to select and format cells but restrict them from making changes to the workbook’s structure, such as adding or deleting worksheets.

3. What are the 3 types of protection in Excel?

Answer: A workbook can be protected at the file or worksheet level in Excel. Excel provides three levels of password protection: password protection for opening files, password protection for changing data, and password protection for adding, deleting, or hiding worksheets.


Protect Workbook in Excel: Knowledge Hub


<< Go Back to Excel Protect | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nujat Tasnim
Nujat Tasnim

Nujat Tasnim, BSc in Computer Science and Engineering from American International University-Bangladesh, has a year-long tenure with ExcelDemy. Initially a Content Developer at SOFTEKO, she transitioned to the Software Team as Junior Software Quality Assurance Engineer. Currently serving as a Junior SQA Engineer at SOFTEKO, she excels in SDLC, STLC, and requirement analysis and possesses profound insights into OOP-related software development processes. Nujat is also proficient in design software like Photoshop and Illustrator, contributing diverse skills to her... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo