Ниже кода VBA, но я не могу управлять им. Есть ли способ открыть код VBA из другого кода VBA с защищенным паролем VBAProject.
Sub UnprotecPassword()
Dim currentActiveWb As Workbook
Set wb = ActiveWorkbook
If wb.VBProject.Protection <> 1 Then
Exit Sub
End If
Set currentActiveWb = ActiveWorkbook
wb.Activate
SendKeys "%{F11}"
SendKeys "^r" ' Set focus to Explorer
SendKeys "{END}" ' Tab to locked project
SendKeys "~" ' Enter
SendKeys "pass"
SendKeys "~" ' Enter
If (wb.VBProject.Protection = vbext_pp_locked) Then
MsgBox ("failed to unlock")
End If
currentActiveWb.Activate
End Sub