View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
trooper665 trooper665 is offline
external usenet poster
 
Posts: 8
Default Adding Excel charts to PowerPoint presentation in Office 2003

In Office 2000 this code worked perfectly:

Dim xlCurrChart As Excel.Chart
Dim xlBook As Excel.Workbook
Dim pptShape As PowerPoint.Shape

Set pptShape = rpptTarget.Shapes.AddOLEObject(Width:=fDefaultWidt h,
Height:=fDefaultHeight, ClassName:="Excel.Sheet")

Set xlBook = pptShape.OLEFormat.Object
Set xlCurrChart = xlBook.Charts.Add()

But now testing this with Office 2003, the last line raises an error. The
weird thing is that this code is in a loop and the error is only raised the
first time that this code fires. After the first loop, the code no longer
raises any errors and works fine.

The error message is:
Error number: - 2147417851 method '~' of object '~' failed.

Any ideas?