Excel workbooks might contain sensitive information like bank account numbers, employee addresses, social security numbers, critical weekly reports a or company’s financial reports. My online Excel classes will not only teach you how to create these spreadsheets, but also how to protect them in the Excel tutorial below.
In this article, you will learn to password protect an Excel file. This can be achieved by using the native GUI method or a macro. So, now let’s see how this is done.
What is the Easiest Way to Password Protect Excel Files?
Step 1: From the file menu, click protect workbook under info. Then click on encrypt with password.
Step 2: This will bring up a dialogue box with the title “encrypt document”. Within this dialogue box, click on the text field with the title “password” and then type your password. Do note that there are character limitations for this password field. Maximum allowed character count is 255. The encryption used in this feature is 128-bit AES advanced encryption.
Step 3: After typing the password, press OK on the dialogue box. Now you will see another dialogue box asking you to retype the password. This is to confirm your password is correct.
Step 4: If you type in a wrong password, Excel will display a message box with the following text: “confirmation password is not identical.” If you type the correct password, the dialogue box will disappear. The option “encrypt with password” would now be highlighted in grey. This shows that your Excel file is now encrypted with a password.
Step 1: From the file menu, click on protect workbook under Info and then click on protect workbook structure.
Step 2: You would immediately see a dialogue box where you can enter a password. Unlike the former method “encrypt with password”, it is not compulsory to type in a password. You can leave the password field empty and click OK.
Don’t forget to check the “structure” option. This helps you to prevent unwanted changes to the workbook’s structure. If the workbook’s structure is protected, users cannot add/delete sheets from the workbook.
This option to password protect Excel is available under “save” and “save as”. Read on in the Excel class content below to learn this easy method of password-protecting your Excel documents.
Step 1: When you save your file, you will be able to see the link “more options”. Click on it.
Step 2: Once you click on ‘more options’, a dialogue box will open. Click on tools and select general options.
Step 3: You will now be prompted to enter a password. There would be two password fields. The first password field is used to restrict users from opening the file. The second password field is used to restrict users from modifying the file.
Step 4: The next step would be to enter the password. You should enter the password once again to confirm.
Step 5: Your workbook is now protected. Whenever users try to open your workbook, they have to type in the password to access or modify it.
Step 6: If you check the option “always create backup”, a backup file would be created in the same path of your source file. The naming convention is “backup of % your source file name % .xlk”
When you try to open the backup file, you will still have to use the password to unlock it. Though the backup file is created by Excel, you will still see “the file format and extension don’t match” warning. Click yes and you can open the backup file.
In this method, you will have to paste a snippet of code into a new module in the VBA editor and execute it. If you aren’t comfortable with modules and VBA, we suggest taking some additional Excel training to familiarise yourself.
This macro will show a dialogue box and prompt you to enter a password. Enter your password and press OK. Your workbook is now password protected but not saved. When you try to save your workbook, you can continue to save it as a macro free workbook.
Dim v_pwd As String
v_pwd = InputBox(“Please Enter the password”)
ActiveWorkbook.Protect Password:=v_pwd, Structure:=True
Password in this script is an optional variable. The password string is case sensitive. However, if you leave the password field blank, your workbook can be unprotected with a blank password. The option “structure := true” implies that the structure of your workbook would be protected. The default value for this option is false. It is necessary to mention ‘true’ explicitly.
Can the Script Be Modified?
This script protects your active workbook. You can modify this script by including folder browser function and allowing the users to select a folder. The script can be revised to read all Excel files in the selected folder and enable password protection in all files or in a group of files.
What If You’ve Forgotten Your Password?
Do not lose or forget the password that you use for protecting your Excel files because it cannot be recovered. Also, please do note that the password used to protect your Excel files are case sensitive.
Please note, this guide on how to password protect Excel worksheets applies to Excel 2016 and might vary across versions of Excel.
Excel Classes Will Help You Protect Your Sensitive Information
Having important, private information in a secure document is of the utmost importance. Fortunately, as the Excel tutorial above demonstrates, password-protecting your Excel workbooks is easy. But if you find yourself struggling with this concept, additional Excel classes will put you on the right track.