Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing VBProject properties....

Status
Not open for further replies.

buba

Technical User
Dec 31, 2002
3
US
thanks JustinEzequiel, for your valuable suggestions. they worked.. a final query though - We can lock a project for viewing and assign password to our project, using the 'Project Properties' dialog box. Can the same be done using any VBA coding?
Regards,
Buba
 
I have had success doing something like this (only able to do this from memory, sorry) :

VBProject.Unprotect sPassword
wbRef.VBProject.VBComponents.Remove
wbRef.VBProject.VBComponents("Module1")
VBProject.Protect sPassword

Be warned however. If the activesheet or visible form contains a command button that has

TakeFocusOnClick = true,

the code fails. Set it to false and it works fine.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top