Why does this simple ppa fail only in v2000?

C

c mateland

Hi.

Can someone enlighten me as to why the following ppa works in
v2002/2003, but not in v2000?

It's saved as LaunchFile.ppa and I loaded it manually through
Tools>Add-Ins. Upon manual load, it successfully opens the targeted
file. But upon exit and restart of PowerPoint, it starts the add-in,
which launches the Auto_Open procedure but it fails when it tries to
open the file. I had other code before it and those lines ran fine, so
I know the add-in is launching correctly. But this line chokes - and
only on v2000.

Sub Auto_Open()
Presentations.Open FileName:="C:\OpenMe.ppt"
End Sub

Isn't this supposed to work? Thanks for any help.

Chuck
 
M

Michael Koerner

Have you by chance password protected your presentation?

--
<>Please post all follow-up questions/replies to the newsgroup<>
<><>Email unless specifically requested will not be opened<><>
<><><>Do Provide The Version Of PowerPoint You Are Using<><><>
<><><>Do Not Post Attachments In This Newsgroup<><><>
Michael Koerner [MS PPT MVP]
 
M

Michael Koerner

Should have read your intial message mor thoroughly. Saving your file as a
..ppa is saving a a PowerPoint addin. yoiu need to save your presentaion as
PowerPoint presentation .ppt or PowerPoint Slidesjow .pps file.

--
<>Please post all follow-up questions/replies to the newsgroup<>
<><>Email unless specifically requested will not be opened<><>
<><><>Do Provide The Version Of PowerPoint You Are Using<><><>
<><><>Do Not Post Attachments In This Newsgroup<><><>
Michael Koerner [MS PPT MVP]
 
C

c mateland

No, it's supposed to be a ppa, and I understand the difference.

This ppa is autoloaded and upon start of PowerPoint it's supposed to
open a specific file. It's actually quite a simple concept. I can't
understand why 2000 won't work. I know PowerPoint 2000 can run that
line of code because it works when I first manually load the ppa. But
when I exit/restart PowerPoint, the line fails, although the ppa opened
fine.

So, can you, yourself, create a ppa with that simple line of code and
have it open a basic ppt file upon start of PowerPoint 2000? What about
2002/2003?
 
M

Michael Koerner

Can I? Nope, I'm not a code person. Hopefully one of the experts will see
this and offer a solution.

--
<>Please post all follow-up questions/replies to the newsgroup<>
<><>Email unless specifically requested will not be opened<><>
<><><>Do Provide The Version Of PowerPoint You Are Using<><><>
<><><>Do Not Post Attachments In This Newsgroup<><><>
Michael Koerner [MS PPT MVP]
 
C

c mateland

No, there are no incompatible objects. That's what's blowing my mind.

Let me clarify again that the ppa has but three lines of code, those
being this:

Sub Auto_Open()
Presentations.Open FileName:="C:\OpenMe.ppt"
End Sub

Do you see any 2000-incompatible objects there?

And it can't be incompatible because, as I said, v2000 ran it 1) when I
ran it as code in a ppt before saving as a ppa, and 2) as a ppa when I
loaded it as an add-in.

It's just that it errors when running the ppa as a loaded add-in at the
launch of PowerPoint.

What am I missing? Can't version 2000 auto_open a file from an add-in
at launch of PowerPoint?
 
C

c mateland

Hi, Steve. Yeah, I did the msgbox thing early on and found the msgboxes
to run fine.

I think this is an established problem but one that either users have
not yet run into or have forgotten about from v2000. I found in the
archives where you, yourself, addressed this back in 98 for a 97 user
and since it has been brought up a few more times for v2000.

Your solution was to make the file-open command as a seperate procedure
(sub) and have the Auto_Open procedure call it. In the procedure, you
set an application object, which puts a new twist on it. Anyway, the
users said it worked.

I'll be testing it on a v2000 machine today and will let you know.

Here is your archived response:
http://tinyurl.com/73zyp

Thanks,
Charles
 
D

David M. Marcovitz

Hi, Steve. Yeah, I did the msgbox thing early on and found the
msgboxes to run fine.

I think this is an established problem but one that either users have
not yet run into or have forgotten about from v2000. I found in the
archives where you, yourself, addressed this back in 98 for a 97 user
and since it has been brought up a few more times for v2000.

Steve has forgotten more about PowerPoint than most of us will ever know:)
--David
 
C

c mateland

It works!!!
It works!!!
It works!!!
It works!!!

Now, I'll test the concept rolled into my larger code. It should work,
but I'll let you know. Also, since versions 2000-2003 will use this
add-in, I'll have to add a condition like, "if application.version = 9
then... ". That shouldn't be a problem either, however.

-Charles
 
C

c mateland

Works great!

Inside the full routine it works on all versions. But because of the
application object needed for version 2000, I had to add if-logic that
checks the version number and then calls the outside procedure to open
the file or it can just use a more simple open command for later
versions.

So, it all works now, and I still have to field test it, but I have
high hopes it will be fine.

Steve, this was part of very large project that automates our corporate
PowerPoint applications worldwide. I hated that such a small line of
code was going to kill it. Thankfully, you had addressed this way back
in 98 and it was the needeed solution for me today. Thank goodness for
you and thank goodness for archives! <g>

Seriously, Steve, you saved my sanity once again. I wish I had the
resources to thank you to the level you deserve it. Maybe one day I
will. In the meantime, please accept my very sincere and deep
appreciciation for all your generousity.

-Charles Mateland
 
A

Austin Myers

Be careful about using a version=9 statement. In many cases it would be
version 9.xxx.xxx something.


Austin Myers
MS PowerPoint MVP Team

PowerPoint Video and PowerPoint Sound Solutions www.pfcmedia.com
 
C

c mateland

Thanks, Austin, but are you certain about that?

The numbering convention you speak of I understood to be the version
plus the build number, with the build being after the first decimal.
Although the build portion changes, the version remains constant.

Check it on your machine...

Sub Version()
MsgBox "This is version " & Application.Version
End Sub
Sub VersionAndBuild()
MsgBox "This is version " & Application.Version _
& " with build " & Application.Build _
& " Otherwise known as " & _
Application.Version & Application.Build
End Sub

Is there some case where this is not true?

Thanks,
Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top