0
Hello, I need to run a macro which is the Private Sub Workbook_BeforeSave
however the spreadsheet points out that the project is protected and therefore does not execute.
I wanted to know how to call the password box, so I can unlock and lock quickly.
The code I’m trying to use:
Sub ProtectVBProject()
Dim wb As Workbook
Set wb = ActiveWorkbook
' Ativa a planilha a ser bloqueada
wb.Activate
' Envia o comando para abrir o VBA
SendKeys "%{F11}", True
' Abre a janela de proteção do projeto VBA
wb.VBProject.VBE.CommandBars(1).FindControl(ID:=761, recursive:=True).Execute ' Aqui eu precisaria do ID da caixa da senha
End Sub
If possible would like a light. I tried to search the possible ID’s, I did not find any compatible.
Why are you calling this ID
761
? It is not the project’s protection window, it is the ID2578
which is what calls the properties of the project.– Marco
Queria saber qual é o numero do hahaha
huh?– Oralista de Sistemas