Open password protected ppt file using excel vba

  • Thread starter Thread starter Boss
  • Start date Start date
B

Boss

Dim pptfile As Object
On Error Resume Next
Application.DisplayAlerts = false

Set pptfile = CreateObject("powerpoint.application")
pptfile.Visible = True

Set pshow = pptfile.Presentations.Open(FileItem, Password:="")

With pshow
.Password = "test" ' ppt password
.SaveAs FileItem
.Close
End With
pptfile.Quit
Application.DisplayAlerts = True
End If

How can i pass password from the vba code.
If the file does not have a password then it catches error.
Any help is greatly appreciated.

thx!
 
Back
Top