Heben Sie den Schutz von VBProject vor VB-Code auf

Wie kann ich den Schutz meines VB-Projekts vor einem VB-Makro aufheben? Ich habe diesen Code gefunden:

    Sub UnprotectVBProject(ByRef WB As Workbook, ByVal Password As String)
  Dim VBProj As Object
  Set VBProj = WB.VBProject
  Application.ScreenUpdating = False
  'Ne peut procéder si le projet est non-protégé.
  If VBProj.Protection <> 1 Then Exit Sub
  Set Application.VBE.ActiveVBProject = VBProj
  'Utilisation de "SendKeys" Pour envoyer le mot de passe.

  SendKeys Password & "~"
  SendKeys "~"
  'MsgBox "Après Mot de passe"
  Application.VBE.CommandBars(1).FindControl(ID:=2578, recursive:=True).Execute
  Application.Wait (Now + TimeValue("0:00:1"))

End Sub

Diese Lösung funktioniert jedoch nicht für Excel 2007. Sie zeigt das Fenster der Authentifizierung und das Druckkennwort in meiner IDE an.

Mein Ziel ist es dann, den Schutz meines VB-Projekts aufzuheben, ohne dieses Fenster anzuzeigen.

Danke für jede Hilfe.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage