Powerpoint Library 10.0 vs 9.0

  • Thread starter Thread starter Blake
  • Start date Start date
B

Blake

Hello, I created a program that exports charts from excel
xp to powerpoint xp, and it works flawlessly. But when I
go to use it in Office 2000 it bombs! :( I believe it is
because the reference in 2000 is the Powerpoint 9.0
Library. If I copy the 10.0 Library from an Office XP
system and put it on the Machine that has 2000 will it
work?
Thank you
Blake
 
Hi Blake,

I use a rather esotheric language to control PP via OLE, and have found that
we need to pay attention to differences in versions. The following code is
what I use to bind the MSGraph component, according to the version of Office
installed:

Version 8 - Office 97
VBE.VBProjects(1).References.AddFromFile("' & MSOfficePath &
'\Office\GREN50.OLB")

Version 9 - Office 2000
VBE.VBProjects(1).References.AddFromFile("' & MSOfficePath &
'\Office9\Graph.exe")

Version 10 - Office XP
VBE.VBProjects(1).References.AddFromFile("' & MSOfficePath &
'\Office10\Graph.exe")

I don't know how to get the Office version from a VB code, so I inform it on
an INI file, together with the MSOfficePath

HTH
 
Blake,
If you compile the code in the earliest version of PPT you are going
to use it will work in all versions higher. the reference will be
automatically upgraded but it is not automatically downgraded as you
have seen.

And the code to get the version of PPT runniing is
dim dversionApp as double
dversionApp = Application.Version
msgbox dversionApp

Brian Reilly, PowerPoint MVP
 
And the code to get the version of PPT runniing is
dim dversionApp as double
dversionApp = Application.Version
msgbox dversionApp

With caution. .Version returns a string. VB is loose about this sort of
thing and will usually convert on the fly. Sometimes that's good.
Sometimes that leads to inscrutable buglettinas.
 
Oh Stevie, my most buglettinas ami,
Would you still consider this a bug if you used my code which is
probably something like this

If Left(Application.Version, 1) <> 8 Then

which checks the application.version first character as 8 or 9 or 1(0)
and then does something. Could be cleaned up with a
Select Case Left)Application.Version, 1)

End select
kind of thingie I should suspect. don't know where your suspicions are
coming from dude.
Brian Reilly, PowerPoint MVP, Version 1.0


'
 
Would you still consider this a bug if you used my code which is
probably something like this

If Left(Application.Version, 1) <> 8 Then

That's much better, you old Cannes man.
Now you're treating it as a string, not a double.
Which is the single best thing to do.
 
Back
Top