How to Unlock VBA project property through VBA

MUKESHY12390

Well-known Member
Joined
Sep 18, 2012
Messages
901
Office Version
  1. 2013
  2. 2011
  3. 2010
  4. 2007
Platform
  1. Windows
Hi All,

I have built one macro , which adds the code (write/add event automatically) to new sheet.

code works fine up to mark. but since this particular stuff will be using by10-30 user so there is possibility someone can mess with code or not intentionally change the code.

I'm looking to protect the VBA project but if I protect, macro can't write code (add write/add event automatically) because of protection.

I would be wondering is there way to unlock the property first (through VBA code) and end of macro re-protect the property.


Any help would be much appreciated.



Regards,
Mukesh Y
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
thanks for your quick reply.

"Sendkey" is something I avoid using, I'm looking for other method let't see if I find out.
 
Upvote 0
Google the exact phase below then read the posts from the top (I won't paste a link because it is a different forum)...

Unprotect VBProject from VB code
 
Upvote 0
thanks, this is something I was looking for . let me play with this code.

will post here if everything works fine.
 
Upvote 0
thanks, this is something I was looking for . let me play with this code.

will post here if everything works fine.

Probably the bigger issue is that you need to close and reopen the workbook after re-protecting the vbproject othetwise it won't take effect.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top