title: Developed VBA code with password protected VBAProject needs to be changed with known password via VBA code
body: <p>Below the VBA code but I can not manage it. Is there any way to open VBA code from other VBA code with password-protected VBAProject.</p>
  
  <pre><code>Sub UnprotecPassword()
  
  Dim currentActiveWb As Workbook
  
  Set  wb = ActiveWorkbook
  
  If wb.VBProject.Protection &lt;&gt; 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
  </code></pre>
  
  <p>End Sub</p>