PC Review


Reply
Thread Tools Rate Thread

Adding Excel charts to PowerPoint presentation in Office 2003

 
 
=?Utf-8?B?dHJvb3BlcjY2NQ==?=
Guest
Posts: n/a
 
      30th Sep 2005
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?

 
Reply With Quote
 
 
 
 
Brian Reilly, MVP
Guest
Posts: n/a
 
      3rd Oct 2005
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"
<(E-Mail Removed)> wrote:

>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?

 
Reply With Quote
 
Steve Rindsberg
Guest
Posts: n/a
 
      5th Oct 2005
In article <50B8EB3D-FD17-4722-A1A1-(E-Mail Removed)>, Trooper665
wrote:
> 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?
>


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
================================================


 
Reply With Quote
 
=?Utf-8?B?dHJvb3BlcjY2NQ==?=
Guest
Posts: n/a
 
      10th Oct 2005
Unfortunately, the error doesn't seem to be trappable. This problem is
really driving me nuts. The DoEvents suggestion didn't work either.

Thanks,
Jeff

"Brian Reilly, MVP" wrote:

> 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"
> <(E-Mail Removed)> wrote:
>
> >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?

>

 
Reply With Quote
 
Steve Rindsberg
Guest
Posts: n/a
 
      10th Oct 2005
In article <3D1D4F60-EFF3-407D-9CB1-(E-Mail Removed)>, Trooper665
wrote:
> Unfortunately, the error doesn't seem to be trappable. This problem is
> really driving me nuts. The DoEvents suggestion didn't work either.


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?


>
> Thanks,
> Jeff
>
> "Brian Reilly, MVP" wrote:
>
> > 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"
> > <(E-Mail Removed)> wrote:
> >
> > >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?

> >

>


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


 
Reply With Quote
 
=?Utf-8?B?dHJvb3BlcjY2NQ==?=
Guest
Posts: n/a
 
      10th Oct 2005
There is error handling in the subroutine that this code is in, but the error
doesn't get handled there. When the error actually raises this is the
message: Error number: - 2147417851 method '~' of object '~' failed. Which
isn't very helpful. Hope that makes sense.

Thanks,
Jeff

"Steve Rindsberg" wrote:

> In article <3D1D4F60-EFF3-407D-9CB1-(E-Mail Removed)>, Trooper665
> wrote:
> > Unfortunately, the error doesn't seem to be trappable. This problem is
> > really driving me nuts. The DoEvents suggestion didn't work either.

>
> 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?
>
>
> >
> > Thanks,
> > Jeff
> >
> > "Brian Reilly, MVP" wrote:
> >
> > > 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"
> > > <(E-Mail Removed)> wrote:
> > >
> > > >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?
> > >

> >

>
> -----------------------------------------
> Steve Rindsberg, PPT MVP
> PPT FAQ: www.pptfaq.com
> PPTools: www.pptools.com
> ================================================
>
>
>

 
Reply With Quote
 
Steve Rindsberg
Guest
Posts: n/a
 
      10th Oct 2005
In article <DECA708F-EA25-4534-8D01-(E-Mail Removed)>, Trooper665 wrote:
> There is error handling in the subroutine that this code is in, but the error
> doesn't get handled there. When the error actually raises this is the
> message: Error number: - 2147417851 method '~' of object '~' failed. Which
> isn't very helpful. Hope that makes sense.


It literally says " method [tilde character]"?
If not, what are the specific objects and methods mentioned?

>
> Thanks,
> Jeff
>
> "Steve Rindsberg" wrote:
>
> > In article <3D1D4F60-EFF3-407D-9CB1-(E-Mail Removed)>, Trooper665
> > wrote:
> > > Unfortunately, the error doesn't seem to be trappable. This problem is
> > > really driving me nuts. The DoEvents suggestion didn't work either.

> >
> > 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?
> >
> >
> > >
> > > Thanks,
> > > Jeff
> > >
> > > "Brian Reilly, MVP" wrote:
> > >
> > > > 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"
> > > > <(E-Mail Removed)> wrote:
> > > >
> > > > >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?
> > > >
> > >

> >
> > -----------------------------------------
> > Steve Rindsberg, PPT MVP
> > PPT FAQ: www.pptfaq.com
> > PPTools: www.pptools.com
> > ================================================
> >
> >
> >

>


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


 
Reply With Quote
 
=?Utf-8?B?dHJvb3BlcjY2NQ==?=
Guest
Posts: n/a
 
      11th Oct 2005
Hi Steve,

Yes, it literally says method '~' of object '~' failed. Definitely the
worst error message I have ever encountered.

Thanks,
Jeff

"Steve Rindsberg" wrote:

> In article <DECA708F-EA25-4534-8D01-(E-Mail Removed)>, Trooper665 wrote:
> > There is error handling in the subroutine that this code is in, but the error
> > doesn't get handled there. When the error actually raises this is the
> > message: Error number: - 2147417851 method '~' of object '~' failed. Which
> > isn't very helpful. Hope that makes sense.

>
> It literally says " method [tilde character]"?
> If not, what are the specific objects and methods mentioned?
>
> >
> > Thanks,
> > Jeff
> >
> > "Steve Rindsberg" wrote:
> >
> > > In article <3D1D4F60-EFF3-407D-9CB1-(E-Mail Removed)>, Trooper665
> > > wrote:
> > > > Unfortunately, the error doesn't seem to be trappable. This problem is
> > > > really driving me nuts. The DoEvents suggestion didn't work either.
> > >
> > > 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?
> > >
> > >
> > > >
> > > > Thanks,
> > > > Jeff
> > > >
> > > > "Brian Reilly, MVP" wrote:
> > > >
> > > > > 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"
> > > > > <(E-Mail Removed)> wrote:
> > > > >
> > > > > >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?
> > > > >
> > > >
> > >
> > > -----------------------------------------
> > > Steve Rindsberg, PPT MVP
> > > PPT FAQ: www.pptfaq.com
> > > PPTools: www.pptools.com
> > > ================================================
> > >
> > >
> > >

> >

>
> -----------------------------------------
> Steve Rindsberg, PPT MVP
> PPT FAQ: www.pptfaq.com
> PPTools: www.pptools.com
> ================================================
>
>
>

 
Reply With Quote
 
Steve Rindsberg
Guest
Posts: n/a
 
      11th Oct 2005

> Yes, it literally says method '~' of object '~' failed. Definitely the
> worst error message I have ever encountered.


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.


>
> Thanks,
> Jeff
>
> "Steve Rindsberg" wrote:
>
> > In article <DECA708F-EA25-4534-8D01-(E-Mail Removed)>, Trooper665 wrote:
> > > There is error handling in the subroutine that this code is in, but the error
> > > doesn't get handled there. When the error actually raises this is the
> > > message: Error number: - 2147417851 method '~' of object '~' failed. Which
> > > isn't very helpful. Hope that makes sense.

> >
> > It literally says " method [tilde character]"?
> > If not, what are the specific objects and methods mentioned?
> >
> > >
> > > Thanks,
> > > Jeff
> > >
> > > "Steve Rindsberg" wrote:
> > >
> > > > In article <3D1D4F60-EFF3-407D-9CB1-(E-Mail Removed)>, Trooper665
> > > > wrote:
> > > > > Unfortunately, the error doesn't seem to be trappable. This problem is
> > > > > really driving me nuts. The DoEvents suggestion didn't work either.
> > > >
> > > > 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?
> > > >
> > > >
> > > > >
> > > > > Thanks,
> > > > > Jeff
> > > > >
> > > > > "Brian Reilly, MVP" wrote:
> > > > >
> > > > > > 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"
> > > > > > <(E-Mail Removed)> wrote:
> > > > > >
> > > > > > >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?
> > > > > >
> > > > >
> > > >
> > > > -----------------------------------------
> > > > Steve Rindsberg, PPT MVP
> > > > PPT FAQ: www.pptfaq.com
> > > > PPTools: www.pptools.com
> > > > ================================================
> > > >
> > > >
> > > >
> > >

> >
> > -----------------------------------------
> > Steve Rindsberg, PPT MVP
> > PPT FAQ: www.pptfaq.com
> > PPTools: www.pptools.com
> > ================================================
> >
> >
> >

>


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


 
Reply With Quote
 
=?Utf-8?B?dHJvb3BlcjY2NQ==?=
Guest
Posts: n/a
 
      12th Oct 2005
Yeah, unfortunately I tried that already and came away with nothing.

I could understand if Microsoft decided to change the parameters to one of
the calls or something, but for it to work on subsequent calls is really just
odd.

Thanks for trying to help,
Jeff

"Steve Rindsberg" wrote:

>
> > Yes, it literally says method '~' of object '~' failed. Definitely the
> > worst error message I have ever encountered.

>
> 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.
>
>
> >
> > Thanks,
> > Jeff
> >
> > "Steve Rindsberg" wrote:
> >
> > > In article <DECA708F-EA25-4534-8D01-(E-Mail Removed)>, Trooper665 wrote:
> > > > There is error handling in the subroutine that this code is in, but the error
> > > > doesn't get handled there. When the error actually raises this is the
> > > > message: Error number: - 2147417851 method '~' of object '~' failed. Which
> > > > isn't very helpful. Hope that makes sense.
> > >
> > > It literally says " method [tilde character]"?
> > > If not, what are the specific objects and methods mentioned?
> > >
> > > >
> > > > Thanks,
> > > > Jeff
> > > >
> > > > "Steve Rindsberg" wrote:
> > > >
> > > > > In article <3D1D4F60-EFF3-407D-9CB1-(E-Mail Removed)>, Trooper665
> > > > > wrote:
> > > > > > Unfortunately, the error doesn't seem to be trappable. This problem is
> > > > > > really driving me nuts. The DoEvents suggestion didn't work either.
> > > > >
> > > > > 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?
> > > > >
> > > > >
> > > > > >
> > > > > > Thanks,
> > > > > > Jeff
> > > > > >
> > > > > > "Brian Reilly, MVP" wrote:
> > > > > >
> > > > > > > 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"
> > > > > > > <(E-Mail Removed)> wrote:
> > > > > > >
> > > > > > > >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?
> > > > > > >
> > > > > >
> > > > >
> > > > > -----------------------------------------
> > > > > Steve Rindsberg, PPT MVP
> > > > > PPT FAQ: www.pptfaq.com
> > > > > PPTools: www.pptools.com
> > > > > ================================================
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > > -----------------------------------------
> > > Steve Rindsberg, PPT MVP
> > > PPT FAQ: www.pptfaq.com
> > > PPTools: www.pptools.com
> > > ================================================
> > >
> > >
> > >

> >

>
> -----------------------------------------
> Steve Rindsberg, PPT MVP
> PPT FAQ: www.pptfaq.com
> PPTools: www.pptools.com
> ================================================
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel charts inserted into Powerpoint presentation - editing & clo Maureen D. Microsoft Powerpoint 2 29th Aug 2008 04:23 PM
Linking Excel Charts to PowerPoint (Office 2003) valerie Microsoft Excel Programming 0 8th Mar 2007 02:27 PM
Office 2003:Moving several Excel charts into Powerpoint at same ti =?Utf-8?B?QXNzdEludGVyZXN0cw==?= Microsoft Powerpoint 3 25th Apr 2006 03:35 PM
Adding Excel charts to PowerPoint presentation in Office 2003 =?Utf-8?B?dHJvb3BlcjY2NQ==?= Microsoft Excel Programming 0 12th Oct 2005 05:03 PM
embedded excel charts in powerpoint 2003 after upgrade from office =?Utf-8?B?QWxhbg==?= Microsoft Powerpoint 3 1st Jun 2005 03:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 AM.