I protected a power point presentation from user modifying it. However I can\'t use VBA to un-protect it.
I tried to use this code below but it doesn\'t work. It only w
Assuming you know the password, you can open the file with something like:
Presentations.Open("c:\temp\protected_presentation.pptx::password::")
And set the password on a presentation with eg:
ActivePresentation.Password = "Hide_me"
[editing to add a complete tested, working example that assumes a presentation C:\temp\testtest.pptx that's been saved with password opensesame]
Sub TestTest()
Dim oPPTApp As Object
Dim oPPTPres As Object
Set oPPTApp = CreateObject("PowerPoint.Application")
If Not oPPTApp Is Nothing Then
Set oPPTPres = oPPTApp.presentations.Open("C:\temp\test.pptx::opensesame::")
MsgBox oPPTPres.slides(1).Shapes(1).TextFrame.TextRange.Text
oPPTPres.Close
oPPTApp.Quit
End If
End Sub