Previous Thread:   Movie only playing sound in PP

9/30/2005 9:55:05 AM    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:=fDefaultWidth,  
  
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.  
  
Any ideas?



10/3/2005 12:51:26 PM    Re: Adding Excel charts to PowerPoint presentation in Office 2003
I ran into a similar error years ago which would randomly throw an  
  
error like this. I never did figure it out but the workaround was to  
  
capture the error and go to the errorhandler and verify the error  
  
number and if it was this error to go back and try again. Something  
  
like (not tested, just typing logic here)  
  
Sub test()  
  
On Error GoTo errorhandler  
  
TryAgain:  
  
MsgBox "Error" 'just to  
  
'some code that might throw this error  
  
Exit Sub  
  
errorhandler:  
  
Select Case Err  
  
Case Is = 42 'the Err value  
  
GoTo TryAgain  
  
Case Else  
  
Exit Sub  
  
End Select  
  
End Sub  
  
Brian Reilly, MVP  
  
On Fri, 30 Sep 2005 09:55:05 -0700, "trooper665"  
  
<trooper665@discussions.microsoft.com> wrote:

10/4/2005 10:38:07 PM    Re: Adding Excel charts to PowerPoint presentation in Office 2003
In article <50B8EB3D-FD17-4722-A1A1-3291EE9E81D7@microsoft.com>, Trooper665  
  
wrote:  
  
In addition to Brian's suggestions, try adding a DoEvents or two (or three or  
  
five) before the line that errors.  
  
-----------------------------------------  
  
Steve Rindsberg, PPT MVP  
  
PPT FAQ:  www.pptfaq.com  
  
PPTools:  www.pptools.com  
  
================================================

10/10/2005 1:58:40 PM    Re: Adding Excel charts to PowerPoint presentation in Office 2003
In article <3D1D4F60-EFF3-407D-9CB1-6C9CCC6C3EE9@microsoft.com>, Trooper665  
  
wrote:  
  
Hmm.  Then to be more precise, it doesn't raise an error in the usual VB/VBA  
  
sense, else it would be trappable, but it throws up some kind of error message  
  
box?  What's the specific error message?  
  
-----------------------------------------  
  
Steve Rindsberg, PPT MVP  
  
PPT FAQ:  www.pptfaq.com  
  
PPTools:  www.pptools.com  
  
================================================

10/10/2005 6:04:47 PM    Re: Adding Excel charts to PowerPoint presentation in Office 2003
In article <DECA708F-EA25-4534-8D01-740F5C1BB700@microsoft.com>, Trooper665 wrote:  
  
It literally says " method [tilde character]"?  
  
If not, what are the specific objects and methods mentioned?  
  
-----------------------------------------  
  
Steve Rindsberg, PPT MVP  
  
PPT FAQ:  www.pptfaq.com  
  
PPTools:  www.pptools.com  
  
================================================

10/11/2005 12:25:59 PM    Re: Adding Excel charts to PowerPoint presentation in Office 2003
There sure isn't much room for making it more useless.  
  
I plugged the exact error string you give below (thanks for typing it verbatim) into  
  
Google and got a fair number of hits, most of which seem database releated (SQL, MDAC and  
  
the like).  Nothing connected to PPT directly, so no bells are going off at this end.  
  
You might want to do the same to see if anything triggers the Aha experience for you.  
  
-----------------------------------------  
  
Steve Rindsberg, PPT MVP  
  
PPT FAQ:  www.pptfaq.com  
  
PPTools:  www.pptools.com  
  
================================================

10/12/2005 11:54:33 AM    Re: Adding Excel charts to PowerPoint presentation in Office 2003
In article <9F840B94-63A7-45AF-AB48-1B9315DD5344@microsoft.com>, Trooper665  
  
wrote:  
  
S'truth!  
  
I'd keep an eye on the group here to see if anyone else comes up with something  
  
useful;  and if you haven't already done so, by all means post to the  
  
appropriate Excel group as well.