Marco, suponho que você tenha a Senha do Projeto, então voce pode utilizar as rotinas abaixo :
Para Proteger o Projeto:
Código: Selecionar todos
Sub ProtegeVBA()
VBA.SendKeys "%{F11}%(FP)" & "+{TAB}{RIGHT}%B{TAB}" & "1234" & "{TAB}" & "1234" & "~", True
End Sub
Para Desproteger podemos utilizar uma das duas :
Código: Selecionar todos
Sub DesprotegeVBA()
VBA.SendKeys "%{F11}%(FP)" & "1234" & "~" & "+{TAB}{RIGHT}%B{TAB}{DEL}{TAB}{DEL}" & "~", True
End Sub
Sub UnprotectVBAProject()
Interaction.SendKeys "%{F11}"
Interaction.SendKeys "^r"
Interaction.SendKeys "{DOWN}"
Interaction.SendKeys "1234"
Interaction.SendKeys "{ENTER}"
End Sub
Veja tambem os links abaixo :
I cant unlock a vbaproject with VBAhttp://stackoverflow.com/questions/1130 ... t-with-vbaDeleting Modules & Macros with Codehttp://www.mrexcel.com/archive/VBA/29825.htmlUnprotecting VBA Project via VBA code to change codehttp://www.ozgrid.com/forum/showthread.php?t=13006
[]s