View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default unprotecting modules

Unless you have some method to replace the password in the closed file
(which is what the crackers do) the only way (AFAIK) is with SendKeys.
Search "Unlock VBAProject SendKeys" in this ng.

Regards,
Peter T


"mike allen" wrote in message
...
I have my VBAproject protected from viewing my code. I want to write a
macro that will unprotect it so I can delete some other modules. I have
tried:

sub unprotectproject()
ThisWorkbook.VBProject.vbcomponents.Unprotect Password:="ok"
end sub

it doesn't work, though. anyone know the answer? Thanks, Mike Allen