Runtime Error with AddOleObject

E

ER

Hi Folks:

Running MS Office 2003, XP Profesional with latest updates.

I am using an Excel VBA macro to launch a create a ppt. Works great on
my machine, but on others i get a "Runtime Error. Unspecified Error
-2147467259 (80004005)" when it tries to execute the AddOLEObject
statement below. How can I avoid this error? Any help greatly
appreciated.


Dim shp1 As Shape
Dim pth As String
pth = ThisWorkbook.Path
Dim strTempWKB As String
With Application
strTempWKB = Pres.Path & .PathSeparator & "five year data
sheets.xls"
End With

Set shp1 = sld.Shapes.AddOLEObject(Left:=61.75, Top:=114, _
Width:=315.875, Height:=216.25, _
Filename:=strTempWKB, Link:=True) <---- error occurs
on this statement
 

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