Link to home
Start Free TrialLog in
Avatar of p_davis
p_davis

asked on

add powerpoint 11.0 object library

i would like to automatically include the powerpoint 11.0 object library in a macro so users don't have to manually add it by going to tools-->references
anyone have an idea how to do this?
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Hello p_davis,

before you do that there are some questions
- are all users over on powerpoint 2003
- what happens if they upgrade or ave another version installed
- adding references in the macro probably requires take into account some security measures

why not develop your code with the reference added to use intellisense and early binding

and rollout with late binding

for a good discussion on the 2
source: http://support.microsoft.com/default.aspx?scid=kb;EN-US;245115

hope this helps a bit
bruintje
Avatar of p_davis
p_davis

ASKER

all are on 2003 as of now and this is just a side project for my team. it won't be necessary to consider the future event of updating windows.

what security measures are you thinking of

if possible i would like something like c uses when you include libraries
#include 'some library'
Avatar of p_davis

ASKER

by the way the macro is in excell
then you can try this
Application.VBE.ActiveVBProject.References.AddFromFile "c:\Program Files\Microsoft Office\OFFICE11\MSPPT.OLB"

not sure if it makes a difference but i had my macro security to low [as always ;-)]
Avatar of p_davis

ASKER

do i have to declare anything or just paste that at the beginning of my code?
i tried the latter with low security settings and i get the following runtime error
method 'vbe' of object '_Application' failed.

thanks for your help
tried it on 2 different machines and both worked fine with different OS and office versions

it was just an empty workbook, and one small sub

Sub h()
  Application.VBE.ActiveVBProject.References.AddFromFile "D:\Program Files\Microsoft Office\Office10\MSPPT.OLB"
End Sub

not sure how the setup is there
Avatar of p_davis

ASKER

strange,
windows xp pro//office 2003
and i had entered
Application.VBE.ActiveVBProject.References.AddFromFile "C:\Program Files\Microsoft Office\OFFICE11\MSPPT.OLB"
i even tried with() around the path.--same thing
i will try it outside of my code.
Avatar of p_davis

ASKER

nope,
tried it in a new workbook, new sub and i still get the same error. are you using 2003? i saw that in the last post you but office10
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of p_davis

ASKER

that was it (trust access to visual basic project)
thanks so much
P
Avatar of p_davis

ASKER

i bumped the points up a bit