My addin crashes PPT at random intervals.

  • Thread starter Thread starter Mike M.
  • Start date Start date
M

Mike M.

Tested with PPT 2002 and 2003. I have an addin that puts the current
date/time into a text box. PowerPoint crashes and throws up an error dialog
at random intervals from 1/2 hour to several hours. My presentation is
simple text with a "tagged" shape (text box) that my addin looks for and
sticks the time/date into. I am wondering if it is the way I put the text
into the shape. Any comments on the following code? Do I need to delete
the text in the text range each time? Thanks.

Public WithEvents PPTEvent As Application

Private Sub PPTEvent_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
Dim slide As PowerPoint.slide
Dim shp As PowerPoint.Shape
Dim dateStr As String
Dim timeStr As String

' This contains the current slide.
Set slide = Wn.View.slide

' Check each shape for our special shape
For Each shp In slide.Shapes
With shp
If (.Tags.Count > 0) Then
' Check for our date/time shape
If (.Tags.Name(1) = MY_SPECIAL_NAME) Then
' Returns "Wednesday, Jan 27 1993".
dateStr = Format(Date, "dddd, mmm d yyyy")

' format time as desired
' Returns "5:04 PM".
timeStr = Format(Time, "hh:mm AMPM")
.TextFrame.TextRange.text = dateStr & " " & timeStr
End If
End If ' end if tags > 0
End With
Next shp
End Sub
 
Tested with PPT 2002 and 2003. I have an addin that puts the current
date/time into a text box. PowerPoint crashes and throws up an error dialog
at random intervals from 1/2 hour to several hours. My presentation is
simple text with a "tagged" shape (text box) that my addin looks for and
sticks the time/date into. I am wondering if it is the way I put the text
into the shape. Any comments on the following code? Do I need to delete
the text in the text range each time? Thanks.

Any pattern at all to when it crashes? A particular slide or on a slide with
specific content?

What's the text of the error message?

By the way, you might be able to simplify life by simply doing:

With shp
If .Tags(MY_SPECIAL_NAME) = "the value you're after" then ...

If there are no tags or if the tag you're after hasn't been applied to the
shape, it won't error; it'l just return ""
 
So far no discernable pattern. We are still trying to gather data. I am
trying to get the error message from my co-worker.
I am trying your code suggestion because I really like the simple life
(Paris mostly). This problem has become a big deal with some customers so I
am scrambling like a monkey on it. Any suggestions greatly appreciated.
 
P.S. or maybe B.S. <g> The error is just the typical PowerPoint error box
stating, "Microsoft PowerPoint has encountered a problem and needs to close.
Sorry!".
I am working with MS right now to get my MSDN subscription tied to a NG
alias (they are having web site problems) so my posts will pass the MS
newsreader filters. Maybe then John L. will help out. I'll probably be
toast before that happens.
 
Well, if I run with PowerPoint 2003 I do not get a crash running the same
presentation with the same addin. Now isn't that special. :-)
How to get all customers to spend $ to upgrade is the next issue.
 
To keep everyone interested in this thread up to date ;-) the crash only
occurs in PPT2002 SP3. PPT2002 no SP, SP1 and SP2 are all fine. Someone
slipped in this service pack without extensive testing of our addins.

HTH, CMAO
 
Well, if I run with PowerPoint 2003 I do not get a crash running the same
presentation with the same addin. Now isn't that special. :-)

Not a big surprise ... 2002 had several brutal little anklenibblers that make
it crash with the message you saw (or sometimes just go poof and disappear).

Any chance you're mucking about with the page numbering?
 
No page numbering. Just looking for my "specially" tagged text box shape
and sticking date/time in it. We are able to reproduce the problem
consistently in a matter of a few minutes now so it's easier to test.
Somehow SP3 got slipped onto the machines without the addin being tested.
But who would have thought.... <g>
 
No page numbering. Just looking for my "specially" tagged text box shape
and sticking date/time in it. We are able to reproduce the problem
consistently in a matter of a few minutes now so it's easier to test.
Somehow SP3 got slipped onto the machines without the addin being tested.
But who would have thought.... <g>

4sher. If you nail the specifics, PLEASE let us know here, 'kay?
 
I can't imagine how I would determine what was wrong other than PPT2002 SP3
crashes with my specific addin. I have a workaround so unless I get some
spare time I am tabling the issue. I did however manage to get an alias
registered for my MSDN account so that might help me in the future.
 
John, can you see me now? ;-)

Mike_M said:
I can't imagine how I would determine what was wrong other than PPT2002 SP3
crashes with my specific addin. I have a workaround so unless I get some
spare time I am tabling the issue. I did however manage to get an alias
registered for my MSDN account so that might help me in the future.
 
Back
Top