Runtime Error with AddOleObject

  • Thread starter Thread starter ER
  • Start date Start date
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
 
It's not clear from this snippet how sld is dimensioned or where/if you
establish a reference to it.

It might also be worth running a quick test with a file/path that doesn't
include spaces.
 
Back
Top