View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BOSS BOSS is offline
external usenet poster
 
Posts: 123
Default Open password protected ppt files

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!