B
Bert
Earlier I posted a message about this, but thought the problem had to do
with a timer loop. When the suggestions for fixes didn't help, I (after
about 3 hours of changing things around) discovered the following.
First the code: (The button just clicked and previous button clicked are
supposed to turn red, then after two seconds turn gray. The problem is only
the previously clicked button turns red. )
Public Sub BadChoice()
Worksheets(2).OLEObjects.Item(FirstBtnNo).Object.BackColor = Red
Worksheets(2).OLEObjects.Item(BtnNo).Object.BackColor = Red
Application.Wait Now + TimeSerial(0, 0, 2)
Worksheets(2).OLEObjects.Item(BtnNo).Object.BackColor = Gray
Worksheets(2).OLEObjects.Item(FirstBtnNo).Object.BackColor = Gray
End Sub
Now the "rest of the story": This procedure may get called depending on the
user clicking correctly on "Yes" or "No" in either a UserForm or a Msgbox.
(I've tried both userform and msgbox--and both create the problem.) IF I
leave the Userform or Msgbox where it first appears on the screen, then
everything works fine, BUT if I move either the Msgbox or UserForm, the
"no-red" problem happens. (I'm moving it because I'd like to have the
Userform or Msgbox appear at a specific location over the spreadsheet.)
Any suggestions why this is happening and how to fix it?
Thanks.
Bert
with a timer loop. When the suggestions for fixes didn't help, I (after
about 3 hours of changing things around) discovered the following.
First the code: (The button just clicked and previous button clicked are
supposed to turn red, then after two seconds turn gray. The problem is only
the previously clicked button turns red. )
Public Sub BadChoice()
Worksheets(2).OLEObjects.Item(FirstBtnNo).Object.BackColor = Red
Worksheets(2).OLEObjects.Item(BtnNo).Object.BackColor = Red
Application.Wait Now + TimeSerial(0, 0, 2)
Worksheets(2).OLEObjects.Item(BtnNo).Object.BackColor = Gray
Worksheets(2).OLEObjects.Item(FirstBtnNo).Object.BackColor = Gray
End Sub
Now the "rest of the story": This procedure may get called depending on the
user clicking correctly on "Yes" or "No" in either a UserForm or a Msgbox.
(I've tried both userform and msgbox--and both create the problem.) IF I
leave the Userform or Msgbox where it first appears on the screen, then
everything works fine, BUT if I move either the Msgbox or UserForm, the
"no-red" problem happens. (I'm moving it because I'd like to have the
Userform or Msgbox appear at a specific location over the spreadsheet.)
Any suggestions why this is happening and how to fix it?
Thanks.
Bert