(Solved) – Is there a way to open a PowerPoint file with write password as Read-Only with VBA, in the same way as with Word Documents?

(solved)-–-is-there-a-way-to-open-a-powerpoint-file-with-write-password-as-read-only-with-vba,-in-the-same-way-as-with-word-documents?

I want to open a PowerPoint Presentation that has a write password, directly with VBA without showing the dialog box, which asks to enter the password or open as Read-Only.

I can do this in a Word document with the following code:

Sub openWriteProtectedWord()
    Documents.Open FileName:="C:UsersuserDesktopDoc2.docx", ReadOnly:=True
End Sub

When this is executed the file opens automatically without showing the pop-up where I have to click Read-Only button.

The code for PowerPoint:

Sub openWriteProtected()
    Presentations.Open FileName:="C:UsersuserDesktoptest.pptx", ReadOnly:=msoTrue
End Sub

When the code is executed the pop-up dialog shows up to enter password or open as read-only.
Is this a missing feature for PowerPoint, or it is done in another way?

Leave a Reply

Your email address will not be published. Required fields are marked *