TextFrame.Characters.Text stopped working - ?!

mfleuette

New Member
Joined
Sep 18, 2002
Messages
27
I was using the statement

Sheets("GEN").Shapes("Rounded Rectangle 5").TextFrame.Characters.Text = "NOLOG"

to change the text of a Rounded Rectangle on a worksheet. After coding, I was able to click the rectangle and cycle through various values (it toggles from NOLOG to TERSE to FULL and back)

Then I fired off a subroutine that loops through checking values every minute or so.THROUGH AN ERROR:

While the subroutine was looping, I clicked on the box to change the box text value and immediately EXCEL stopped, with an error:

"Unable to set the text property of the characters class"

It continues with this error perpetually.

Any one have any thoughts as to why it would stop working if clicked while a subroutine was running?

Code snippet:

If Sheets("GEN").Range("B2") < 12 Then Sheets("GEN").Range("B2") = 12 'Initialize flags

' MsgBox Application.Caller

If Sheets("GEN").Range("B2") Mod 10 = 1 Then
Sheets("GEN").Shapes("Rounded Rectangle 5").TextFrame.Characters.Text = "NOLOG"
Sheets("GEN").Shapes("Rounded Rectangle 5").Fill.ForeColor.SchemeColor = 4 ' blue
Sheets("GEN").Range("B2") = Sheets("GEN").Range("B2").Value + 1
ElseIf Sheets("GEN").Range("B2") Mod 10 = 2 Then
Sheets("GEN").Shapes("Rounded Rectangle 5").TextFrame.Characters.Text = "TERSE"
Sheets("GEN").Shapes("Rounded Rectangle 5").Fill.ForeColor.SchemeColor = 6 ' pink
Sheets("GEN").Range("B2") = Sheets("GEN").Range("B2").Value + 1
ElseIf Sheets("GEN").Range("B2") Mod 10 = 3 Then
Sheets("GEN").Shapes("Rounded Rectangle 5").TextFrame.Characters.Text = "FULL"
Sheets("GEN").Shapes("Rounded Rectangle 5").Fill.ForeColor.SchemeColor = 8 ' red
Sheets("GEN").Range("B2") = Sheets("GEN").Range("B2").Value - 2
End If

Any help is greatly appreciated!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,215,206
Messages
6,123,638
Members
449,109
Latest member
Sebas8956

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top