How to protect macro-enabled worksheet with own password?

User avatar
PRADEEPB270
3StarLounger
Posts: 354
Joined: 27 Oct 2013, 15:11
Location: Gurgaon INDIA

How to protect macro-enabled worksheet with own password?

Post by PRADEEPB270 »

I have a file with macro-enabled.I want to protect it with a password of my choice.The password should ask every time when it is open every time after closed last.
Can I protect this file with my own choice password? Is it possible?

If yes,please apply the password in my attach file i.e.PASSWORD@1234

Also mention,how it will be re-change.
Regards

Pradeep Kumar Gupta
INDIA

User avatar
HansV
Administrator
Posts: 78531
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How to protect macro-enabled worksheet with own password

Post by HansV »

If you want to set a password that the user must provide to open the workbook, or to be able to edit the workbook:
- Open the workbook.
- Select File | Save As.
- In the Save As dialog, click Tools (to the left of the Save button).
S210.png
- Select General Options...
S211.png
- Specify a password to open, and or a password to modify.
- When you click OK, you'll be asked to enter the password again, as confirmation.
- Save and close the workbook.
- Each time the workbook is opened, the user will be prompted to enter the password.
- When you want to change the password, follow the above steps again.
- Make sure that you do not forget the password!
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
PRADEEPB270
3StarLounger
Posts: 354
Joined: 27 Oct 2013, 15:11
Location: Gurgaon INDIA

Re: How to protect macro-enabled worksheet with own password

Post by PRADEEPB270 »

After providing the password,the existing VBA codes or macro does not work.

Please test the same on my file attach as earlier with the password as PASSWORD@1234
Regards

Pradeep Kumar Gupta
INDIA

User avatar
HansV
Administrator
Posts: 78531
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How to protect macro-enabled worksheet with own password

Post by HansV »

The code still works when I try it. Here is the workbook with the password applied:
1234.xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
PRADEEPB270
3StarLounger
Posts: 354
Joined: 27 Oct 2013, 15:11
Location: Gurgaon INDIA

Re: How to protect macro-enabled worksheet with own password

Post by PRADEEPB270 »

Now,the file is not opening on my pc,attach by you.Entered password pop-up screen is not appearing.I am using MSoffice version 2007.

Should I modify the setting to open the same file sent by you?
Regards

Pradeep Kumar Gupta
INDIA

User avatar
HansV
Administrator
Posts: 78531
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How to protect macro-enabled worksheet with own password

Post by HansV »

Do you get an error message when you try to open the workbook? If so, what does it say?
Best wishes,
Hans

User avatar
PRADEEPB270
3StarLounger
Posts: 354
Joined: 27 Oct 2013, 15:11
Location: Gurgaon INDIA

Re: How to protect macro-enabled worksheet with own password

Post by PRADEEPB270 »

Now it is ok.Many-2 thanks for the nice help in very prompt action.
Regards

Pradeep Kumar Gupta
INDIA