Uncheck lock project for viewing in VBE

YasserKhalil
PlatinumLounger
Posts: 4967
Joined: 31 Aug 2016, 09:02

Uncheck lock project for viewing in VBE

Post by YasserKhalil »

Hello everyone

I need vba code that enables me to do the manual steps of tools > vbaproject properties > Protection tab > uncheck lock project for viewing. Is it possible?

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

Re: Uncheck lock project for viewing in VBE

Post by HansV »

Why do you need that?
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4967
Joined: 31 Aug 2016, 09:02

Re: Uncheck lock project for viewing in VBE

Post by YasserKhalil »

I am working on a file that I should protect with vbe password. And while I am trying a lot of codes and working on temp copy of the main project, after each update I need to get rid of the password quickly and some other tasks so as to work quicker on the temp file..

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

Re: Uncheck lock project for viewing in VBE

Post by HansV »

You could leave the VBE unprotected while you work on it, and only protect it when you send the workbook to others...
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4967
Joined: 31 Aug 2016, 09:02

Re: Uncheck lock project for viewing in VBE

Post by YasserKhalil »

I thought of that but most of the time I forgot to protect it before sending.. Never mind

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

Re: Uncheck lock project for viewing in VBE

Post by HansV »

Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4967
Joined: 31 Aug 2016, 09:02

Re: Uncheck lock project for viewing in VBE

Post by YasserKhalil »

I have already seen this topic and I could unlock the vbe successfully, but after closing the file the vbe asks for the password again so I need a way to uncheck the option I referred in my first post.

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

Re: Uncheck lock project for viewing in VBE

Post by HansV »

That way you can't forget to protect the VBE before sending the workbook to others...
Best wishes,
Hans