Nicolaf
10-20-2015, 01:13 AM
Hi,
I have some code from a previous post to open a Powerpoint presentation from Excel see below:
Private Sub CommandButton28_Click()
' Opens Presentation.pptx
Dim PPT As PowerPoint.Application
Set PPT = New PowerPoint.Application
PPT.Visible = True
PPT.Presentations.Open Filename:="P:\lonib\Presentation.pptx"
End Sub
Now the file I would like to open (Presentation.pptx) is password protected so I would like to open without being asked for password.
I tried amending code to below:
[Private Sub CommandButton28_Click()
' Opens Presentation.pptx
Dim PPT As PowerPoint.Application
Set PPT = New PowerPoint.Application
PPT.Visible = True
PPT.Presentations.Open Filename:="P:\lonib\Presentation.pptx", Password:="Password"
End Sub
But when I run this macro I get error message "Compile error: Named argument not found"
What am I doing wrong?
How should code be amended so that file opens without asking for password and no Compile error message?
Thanks,
Nic
:think::think:
I have some code from a previous post to open a Powerpoint presentation from Excel see below:
Private Sub CommandButton28_Click()
' Opens Presentation.pptx
Dim PPT As PowerPoint.Application
Set PPT = New PowerPoint.Application
PPT.Visible = True
PPT.Presentations.Open Filename:="P:\lonib\Presentation.pptx"
End Sub
Now the file I would like to open (Presentation.pptx) is password protected so I would like to open without being asked for password.
I tried amending code to below:
[Private Sub CommandButton28_Click()
' Opens Presentation.pptx
Dim PPT As PowerPoint.Application
Set PPT = New PowerPoint.Application
PPT.Visible = True
PPT.Presentations.Open Filename:="P:\lonib\Presentation.pptx", Password:="Password"
End Sub
But when I run this macro I get error message "Compile error: Named argument not found"
What am I doing wrong?
How should code be amended so that file opens without asking for password and no Compile error message?
Thanks,
Nic
:think::think: