Since its foundation, MS Excel has been used by many organizations to manage their data and records. These data and records also include confidential information that everyone within an organization should not access. So, what to do with those files that should be used precautiously and must have restricted access? The answer is that you can put password on Excel file to protect it from unauthorized access.

When you password-protect an Excel file, no one can see the file's contents without entering the correct password. This makes your data secure and more confidential. However, in this article, you will find the best ways to password protect an Excel file. If you want to set a password on any of your Excel files, give a read to this article and try out the methods!

Part 1: How to Put Password on Excel File?

Putting a password on an Excel file is not a big deal, but if you are a beginner and do not have enough experience, the following methods will definitely help you!

Method 1: Encrypt an Excel Document:

The most common way to protect an Excel file with a password is to encrypt it. Encrypting means that whenever someone opens the file, they will have to enter a password. Perform the following steps to encrypt an Excel file:

  • Open the Excel file and go to the File menu.
  • Click on Info.

    file menu
  • Click on Protect Workbook button.

    compatibility mode
  • Search for the "Encrypt with password" option and click on it.

    encrypt with password
  • Enter the password you want to set on the file. Click OK.

    encrypt with password
  • Re-enter the password and click OK again.

    confirm password

Next time, when you open the encrypted file, you will need to enter the correct password. You have successfully protected your data from unauthorized access.

Method 2: Add a Password using VBA:

VBA is short for Visual Basic for Applications. It is used to automate the Office applications such as MS Word, MS PowerPoint, MS Excel, etc. it is a programming language that you can use to personalize your Office Applications. If you want to put password on Excel file using VBA, the following are the steps:

  • Open the Excel file you want to protect and go to the View menu.
  • Click on the Macros option to create a new Macro.

    create macro
  • Now enter the Macro name and click on Create button.


    Note that we have used protection as a placeholder. You can name a Macro as anything you want.

    create macro
  • When you click on Create, you will land on a new Window as follows:

    create macro
  • Copy the following code and paste it into the new window as follows:

    Range("A1").Value = "Protection Protected"


    Do not forget to replace the Macro name.

  • Now, go to the Tools menu and click on VBAProject Properties.

    vba project proterties
  • Open the Protection tab when the Project Properties dialog box appears.
  • Now, check the box in front of the "Lock project for viewing" if you want to lock it; else, set the password and click OK to save settings.

    vba project proterties

Bingo! You have protected your Excel file with VBA successfully. No one can intrude on your private data now.

Method 3: Allow Read-only Access:

If you do not want to make all the data and settings inaccessible to other users, you can avail the option of restricted access in MS Excel. Restricted access means limiting the actions that could be performed on a sheet. Simply put, using read-only access, you can determine which users can access, update and edit the file's contents. Read-only access is the best option if you do not want to make the file fully confidential. Instead, you can just limit the actions that could be performed. Here is how to allow read-only access:

  • Open the Excel file, go to File menu and click on Save As.
  • When the Save As dialog box appears, click on the Tools link beside the Save button.

    vba project proterties
  • Select General Options from the list.
  • A new dialog will appear to ask you to enter a password. After entering, click OK.

    general option

Next time when you open the Excel file, you will need to enter the correct password to make any changes. You have put password on Excel file.

Now that you know how to password protect an Excel file, you must also know how to unprotect it if you ever lose the password. The next section of the article will address the problem of opening a password-protected Excel file without a password.

Part 2: How to Unprotect the Excel Sheet if Forgot the Password?

Forgetting the password of an Excel sheet can lead to the loss of essential data. Many people end up deleting their important files after forgetting the password, as it seems impossible to recover the file. However, to rescue you from such a situation, here is the best yet a perfect solution, i.e., PassFab for Excel.

PassFab for Excel:

PassFab for Excel is a brilliant tool specifically designed and programmed to help you recover your password-protected Excel files without any data loss or privacy intrusion. This tool recovers your password quickly and enables you to access your files in no time. To use PassFab for Excel, follow the following guide:

  • Download and install PassFab for Excel from the official site.
  • Launch the application and click the Recover Excel Open Password button.

    recover excel
  • Click on the +(Please import Excel file) to upload the password-protected file.
  • Choose the recovery mode and click the Recover button.

    import excel file
  • After some time, the recovered password will be displayed. Copy the password and paste it into the password field of the Excel file.

    recover password

After completing the processing, you will have found the lost password, and you will be able to access the file contents without losing any data or privacy. Remember that when you put password on Excel file, you need to remember it as there are not many options to avail after losing the password.

Final Words:

MS Excel is an important application that we all use in our day-to-day life. Sometimes we save not so crucial data other times; we have confidential information. Setting a password on Excel sheets and files is the best way to protect them from unauthorized access.

This article covers different ways to put password on Excel sheet and the best way to recover a lost password. We hope that this article will be helpful for you. Thank you for reading it!