Hi everyone,
I've stumbled upon some strange behavior, and I'm hoping you can help me.
I have a rectangle Shape, with the value 0 in it. It's a scoreboard.
When I click on it, a macro fires, and adds 1 to it's total.
That works well... until I get to 10!
When the box is at 9, and I click 1 more time, the score says "1 ".
So it makes space for the 0, but the 0 doesn't appear.
And if I continue to click on the box, it continues to add 1, except I never get to see the 2nd digit.
This is also true for the 20's, 30's etc. So basically, it doesn't want to show the 2nd digit even though it makes a space for it.
At first I thought the box wasn't big enough (even though it IS large enough),
so I made the font extremely small, but the problem still occured.
Then I made the box's value show in a MsgBox() and it would show the correct amount (10, 11, etc).
And another odd thing I found. If I exited the slide show while the score was above 9 (so 10+),
when I started it up again, the score would correctly show the second digit!
Has anyone ever encountered this? Or do you have an idea what might be going wrong?
Here's my code to increment the score by 1:
Sub add1boys()
' Add 1 point to boys.
ActivePresentation.SlideMaster.Shapes("boysScoreBox").TextFrame.TextRange.Text = CLng(ActivePresentation.SlideMaster.Shapes("boysScoreBox").TextFrame.TextRange.Text) + 1
MsgBox ("POINTS: " + ActivePresentation.SlideMaster.Shapes("boysScoreBox").TextFrame.TextRange.Text)
End Sub
So to summarize, it's putting the correct value in the box, but it only displays the 1st digit even if both digits would fit.
Also, when I restart the slide show with the score already above 9, it shows the 2 digits correctly.
Thanks!
- Andrew