Password Protect Excel 2010 & 2007

How To Password Protect Excel & Word Documents?

The Article explains how to secure a document with built in options & then a corresponding VBA Code snippet.

There are different methods available with Microsoft Office version 2007 and above, for Password Protecting Excel, Word and PPT documents. Let’s see one by one.

Applicable To:  MS Excel, Word or PowerPoint of MS Office 2007 and above.

Password Protect Excel 2010, 2007 & Above

Menu Navigation Path: File -> Save As -> Tools -> General Options -> Enter Password

Open the Document that you want to protect with a Password and follow the below steps.

  1. Click on File -> Save As to view a Popup window for entering File Name.
  2. In this popup window, to the left side of “Save” Command Button, there is a drop down named as “Tools”.
  3. Click on this “Tools” Drop down and choose General Option. This will open up a windows for user to enter the “Password to Open” and “Password to Modify

Password Protect Excel Using VBA?

The below VBA code can be used in any of the above explained three documents. The same code is Aapplicable to Password Protect a Word Document also.

It is simple to use this option. But, is it safe to use this option? I leave that decision to the User. Google to find tools that can crack or recover these passwords and you will be able to come to a conclusion.

If you want to provide more protection, then you can choose to encrypt the documents with some available tools or the method discussed in this Related Topic below.

Related: How to Strengthen the Protection by Encrypting Excel using VBA?

Protect Excel Worksheet from Editing

Menu Navigation Path: Review -> Protect Sheet -> Enter Password

Pre-Requisite: Select Cell or Range -> Right Click -> Format Cells -> Protection -> Check “Protection”

With this option, the user can view the data in excel worksheet, but they will not be allowed to edit it. This option is provided to:

  • Prevent user from accidentally modifying any data and
  • Prevent unauthorized users to modify the document.

Lock Editing Excel using VBA?

Below VBA code is used to unlock and enable editing for specific cells and lock all remaining cells.

Restricting Access at User Level

Menu Navigation Path: Review -> Protect Document -> Restricted Access

This option does not provide option to enter password, but, you enforce a user level restriction to Read, Modify and Copy an Excel, Word or PPT document.

Use the above navigation and set required access to the users on who can read and who can modify the document. With this option you can also define what are the options the user is authorized to do and also Manage the user credentials. Refer MSDN to learn more details on these topics.

That’s all about how to secure and password protect your Office Documents. If there are any other possible methods that is missed out here, post us in comments section.

More Tricks: