Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How tp open a password protected powerpoint file by Excel macro

1,213 views
Skip to first unread message

juwen

unread,
Jun 2, 2010, 2:03:01 AM6/2/10
to

How to open a password protected powerpoint file by Excel macro? by the
way,the cipher is known.

Is it possible to do this?

Thanks in advance,


Echo S

unread,
Jun 2, 2010, 7:57:35 AM6/2/10
to

Are you asking about an Excel file that's linked to a PowerPoint
presentation? This is the PowerPoint group, and I'm trying to figure out the
connection between your Excel question and PowerPoint.

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PPT 2010? http://www.echosvoice.com/2010.htm
Fixing PowerPoint Annoyances http://tinyurl.com/36grcd
PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/32a7nx

"juwen" <ju...@discussions.microsoft.com> wrote in message
news:99826EBC-7070-47A1...@microsoft.com...

Gordon

unread,
Jun 2, 2010, 2:43:22 AM6/2/10
to

"juwen" <ju...@discussions.microsoft.com> wrote in message
news:99826EBC-7070-47A1...@microsoft.com...
>

How is this related to PowerPoint?

John Wilson

unread,
Jun 2, 2010, 10:20:01 AM6/2/10
to
As far as I know in PowerPoint there's no method of opening a password
protected file using vba from Excel (or even in directly PowerPoint vba)
Unlike in Excel you cannot specify the password as an argument.
--
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html

Chirag

unread,
Jun 2, 2010, 2:58:49 PM6/2/10
to
PowerPoint does not natively provide a way to open password-protected
presentations. You might want to look at my free openppt.dll that allows you
to supply a password to open a password protected presentation. To use it
from Excel, you would have to create an instance of PowerPoint using
CreateObject() and pass the instance as the first parameter to the
OpenPresentation() function.

More information on openppt.dll is available at
http://officeone.mvps.org/openppt/

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

"juwen" <ju...@discussions.microsoft.com> wrote in message
news:99826EBC-7070-47A1...@microsoft.com...
>

king21c

unread,
Jun 2, 2010, 10:56:14 PM6/2/10
to
I am doing as follows:
1.Place the openppt.dll in the Windows folder (C:\Windows).
2.plug-in a new module
3.write code in new module:
'---------------------------------------------
Sub Test()
Dim Pres As Presentation
Set Pres = OpenPresentation(Application, _
"d:\prespass.ppt", "123", _
False, False, True)
End Sub
'-----------------------------------------------
Error: Run-time Error'424' Object Required

How I am going to do.

Thank you

"Chirag" <Chi...@discussions.microsoft.com> 写入消息新闻:eFIDlWoA...@TK2MSFTNGP05.phx.gbl...

Chirag

unread,
Jun 3, 2010, 2:13:50 PM6/3/10
to
Is 123 the password to open prespass.ppt? If yes and you are still getting
this error, can you please email me your prespass.ppt to help me analyze the
issue? Which PowerPoint version are you using?

- Chirag

"king21c" <kin...@126.com> wrote in message
news:uzacRLzA...@TK2MSFTNGP06.phx.gbl...

Matti Vuori

unread,
Jun 3, 2010, 3:20:22 PM6/3/10
to
"king21c" <kin...@126.com> wrote in
news:uzacRLzA...@TK2MSFTNGP06.phx.gbl:

> I am doing as follows:
> 1.Place the openppt.dll in the Windows folder (C:\Windows).
> 2.plug-in a new module
> 3.write code in new module:
> '---------------------------------------------
> Sub Test()
> Dim Pres As Presentation
> Set Pres = OpenPresentation(Application, _
> "d:\prespass.ppt", "123", _
> False, False, True)
> End Sub
> '-----------------------------------------------
> Error: Run-time Error'424' Object Required
>
> How I am going to do.

You need to add the import declaration at the top of your module, above
your Sub:

Public Declare Function OpenPresentation Lib "openppt.dll" ( _
ByVal PowerPoint As Variant, _
ByVal FileName As String, _
ByVal Password As String, _
ByVal ReadOnly As Boolean, _
ByVal Untitled As Boolean, _
ByVal WithWindow As Boolean) As Variant


juwen

unread,
Jun 4, 2010, 2:58:24 AM6/4/10
to
Chirag

My PowerPoint version is 2003
I want to E-mail the prespass.ppt to you.
Can you give me your valid E-mail.

-juwen

"Chirag" wrote:

> Is 123 the password to open prespass.ppt? If yes and you are still getting
> this error, can you please email me your prespass.ppt to help me analyze the
> issue? Which PowerPoint version are you using?
>
> - Chirag
>
> "king21c" <kin...@126.com> wrote in message
> news:uzacRLzA...@TK2MSFTNGP06.phx.gbl...
> > I am doing as follows:
> > 1.Place the openppt.dll in the Windows folder (C:\Windows).
> > 2.plug-in a new module
> > 3.write code in new module:
> > '---------------------------------------------
> > Sub Test()
> > Dim Pres As Presentation
> > Set Pres = OpenPresentation(Application, _
> > "d:\prespass.ppt", "123", _
> > False, False, True)
> > End Sub
> > '-----------------------------------------------
> > Error: Run-time Error'424' Object Required
> >
> > How I am going to do.
> >
> > Thank you
> >
> > "Chirag" <Chi...@discussions.microsoft.com>

> > дÈëÏûÏ¢ÐÂÎÅ:eFIDlWoA...@TK2MSFTNGP05.phx.gbl...


> >> PowerPoint does not natively provide a way to open password-protected
> >> presentations. You might want to look at my free openppt.dll that allows
> >> you to supply a password to open a password protected presentation. To
> >> use it from Excel, you would have to create an instance of PowerPoint
> >> using CreateObject() and pass the instance as the first parameter to the
> >> OpenPresentation() function.
> >>
> >> More information on openppt.dll is available at
> >> http://officeone.mvps.org/openppt/
> >>
> >> - Chirag
> >>
> >> PowerShow - View multiple PowerPoint slide shows simultaneously
> >> http://officeone.mvps.org/powershow/powershow.html
> >>
> >> "juwen" <ju...@discussions.microsoft.com> wrote in message
> >> news:99826EBC-7070-47A1...@microsoft.com...
> >>>
> >>> How to open a password protected powerpoint file by Excel macro? by the
> >>> way,the cipher is known.
> >>>
> >>> Is it possible to do this?
> >>>
> >>> Thanks in advance,
>

> .
>

Chirag

unread,
Jun 4, 2010, 3:07:53 AM6/4/10
to
You can send me an email at the id listed at the bottom of the same web
page.

- Chirag

"juwen" <ju...@discussions.microsoft.com> wrote in message

news:74E46CDF-F877-4AE2...@microsoft.com...

juwen

unread,
Jun 4, 2010, 3:30:16 AM6/4/10
to

Yes,I added the import declaration at the top of your module,which I forgot
to write

I am doing as follows:
1.Place the openppt.dll in the Windows folder (C:\Windows).
2.plug-in a new module
3.write code in new module:

'--------------------------------------------------------------------


Public Declare Function OpenPresentation Lib "openppt.dll" ( _
ByVal PowerPoint As Variant, _
ByVal FileName As String, _
ByVal Password As String, _
ByVal ReadOnly As Boolean, _
ByVal Untitled As Boolean, _
ByVal WithWindow As Boolean) As Variant

Sub Test()


Dim Pres As Presentation
Set Pres = OpenPresentation(Application, _
"d:\prespass.ppt", "123", _
False, False, True)
End Sub

'-----------------------------------------------------------------------

Arie Livshin

unread,
Aug 1, 2010, 9:48:34 AM8/1/10
to
I need to open a password-protected PowerPoint 2007 presentation from a VSTO in C#. I tried OpenPPT using VBA and it seems to work.

As I need to use C# I tried this code:

?
[DllImport("openppt.dll", EntryPoint = "OpenPresentation")]
public static extern Presentation OpenPresentation(Application PowerPoint, string FileName, string Password, bool ReadOnly, bool Untitled, bool WithWindow);
?
Presentation Pres = OpenPresentation(_application, @"C:\temp\pass1.pptx", "MyPassword",
false, false,
true);

This throws an exception.

1. What am I doing wrong?

2. How are you doing this in OpenPPT, are you injecting keytrokes or using some safer method?


Thank you,
Arie

Chirag wrote:

Is 123 the password to open prespass.ppt?

03-Jun-10

Is 123 the password to open prespass.ppt? If yes and you are still getting
this error, can you please email me your prespass.ppt to help me analyze the
issue? Which PowerPoint version are you using?

- Chirag

Previous Posts In This Thread:

On Wednesday, June 02, 2010 2:03 AM
juwen wrote:

How tp open a password protected powerpoint file by Excel macro


How to open a password protected powerpoint file by Excel macro? by the
way,the cipher is known.

Is it possible to do this?

Thanks in advance,

On Wednesday, June 02, 2010 2:43 AM
Gordon wrote:

How is this related to PowerPoint?
How is this related to PowerPoint?

On Wednesday, June 02, 2010 7:57 AM
Echo S wrote:

Are you asking about an Excel file that is linked to a PowerPointpresentation?
Are you asking about an Excel file that is linked to a PowerPoint
presentation? This is the PowerPoint group, and I am trying to figure out the


connection between your Excel question and PowerPoint.

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PPT 2010? http://www.echosvoice.com/2010.htm
Fixing PowerPoint Annoyances http://tinyurl.com/36grcd
PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/32a7nx

On Wednesday, June 02, 2010 10:20 AM
John Wilson wrote:

As far as I know in PowerPoint there is no method of opening a
As far as I know in PowerPoint there is no method of opening a password


protected file using vba from Excel (or even in directly PowerPoint vba)
Unlike in Excel you cannot specify the password as an argument.
--
john ATSIGN PPTAlchemy.co.uk


"juwen" wrote:

On Wednesday, June 02, 2010 2:58 PM
Chirag wrote:

PowerPoint does not natively provide a way to open
PowerPoint does not natively provide a way to open password-protected
presentations. You might want to look at my free openppt.dll that allows you
to supply a password to open a password protected presentation. To use it
from Excel, you would have to create an instance of PowerPoint using
CreateObject() and pass the instance as the first parameter to the
OpenPresentation() function.

More information on openppt.dll is available at
http://officeone.mvps.org/openppt/

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

On Wednesday, June 02, 2010 10:56 PM
king21c wrote:

I am doing as follows:1.Place the openppt.
I am doing as follows:
1.Place the openppt.dll in the Windows folder (C:\Windows).
2.plug-in a new module
3.write code in new module:
'---------------------------------------------
Sub Test()
Dim Pres As Presentation
Set Pres = OpenPresentation(Application, _
"d:\prespass.ppt", "123", _
False, False, True)
End Sub
'-----------------------------------------------
Error: Run-time Error'424' Object Required

How I am going to do.

Thank you

On Thursday, June 03, 2010 2:13 PM
Chirag wrote:

Is 123 the password to open prespass.ppt?
Is 123 the password to open prespass.ppt? If yes and you are still getting
this error, can you please email me your prespass.ppt to help me analyze the
issue? Which PowerPoint version are you using?

- Chirag

On Thursday, June 03, 2010 7:20 PM
Matti Vuori wrote:

You need to add the import declaration at the top of your module, aboveyour
You need to add the import declaration at the top of your module, above
your Sub:

Public Declare Function OpenPresentation Lib "openppt.dll" ( _
ByVal PowerPoint As Variant, _
ByVal FileName As String, _
ByVal Password As String, _
ByVal ReadOnly As Boolean, _
ByVal Untitled As Boolean, _
ByVal WithWindow As Boolean) As Variant

On Friday, June 04, 2010 2:58 AM
juwen wrote:

ChiragMy PowerPoint version is 2003I want to E-mail the prespass.ppt to you.
Chirag

My PowerPoint version is 2003
I want to E-mail the prespass.ppt to you.
Can you give me your valid E-mail.

-juwen

"Chirag" wrote:

On Friday, June 04, 2010 3:07 AM
Chirag wrote:

You can send me an email at the id listed at the bottom of the same webpage.
You can send me an email at the id listed at the bottom of the same web
page.

- Chirag

On Friday, June 04, 2010 3:30 AM
juwen wrote:

Yes,I added the import declaration at the top of your module,which I forgotto
Yes,I added the import declaration at the top of your module,which I forgot
to write

I am doing as follows:


1.Place the openppt.dll in the Windows folder (C:\Windows).
2.plug-in a new module
3.write code in new module:

'--------------------------------------------------------------------
Public Declare Function OpenPresentation Lib "openppt.dll" ( _
ByVal PowerPoint As Variant, _
ByVal FileName As String, _
ByVal Password As String, _
ByVal ReadOnly As Boolean, _
ByVal Untitled As Boolean, _
ByVal WithWindow As Boolean) As Variant

Sub Test()


Dim Pres As Presentation
Set Pres = OpenPresentation(Application, _
"d:\prespass.ppt", "123", _
False, False, True)
End Sub

'-----------------------------------------------------------------------


Error: Run-time Error'424' Object Required


Submitted via EggHeadCafe - Software Developer Portal of Choice
Changing WCF Service Implementation at Runtime
http://www.eggheadcafe.com/tutorials/aspnet/d9263dcc-f7ed-42f3-bc96-321461be3306/changing-wcf-service-implementation-at-runtime.aspx

0 new messages