Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Command buttons not responding-sticking

I have a form with 30 command buttons that give a label certain value when
clicked

i.e
Private Sub Chk12_Click()
TxtLabel.Value = "12"
End Sub

The problem arises when sometimes it takes several clicks on the same button
to update the value of the label.

Thanks in advance for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default Command buttons not responding-sticking

LuisE wrote:
I have a form with 30 command buttons that give a label certain value when
clicked

i.e
Private Sub Chk12_Click()
TxtLabel.Value = "12"
End Sub

The problem arises when sometimes it takes several clicks on the same button
to update the value of the label.

Thanks in advance for your help


Perhaps insert a well-placed "DoEvents".

Aside, an application with a form with 30 command buttons is crying for
an updated design.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Command buttons not responding-sticking

Thanks smartin

I know, 30 cmds ais too much but that's how my boss wants it.

Could you please ilustrate the use of DoEvents if possible?
Thanks

"smartin" wrote:

LuisE wrote:
I have a form with 30 command buttons that give a label certain value when
clicked

i.e
Private Sub Chk12_Click()
TxtLabel.Value = "12"
End Sub

The problem arises when sometimes it takes several clicks on the same button
to update the value of the label.

Thanks in advance for your help


Perhaps insert a well-placed "DoEvents".

Aside, an application with a form with 30 command buttons is crying for
an updated design.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Command buttons not responding-sticking

hi
sub yoursub()
some code
doevents
more code
doevents
still more code
doevents
maybe some more code
end sub
the doevents keyword turns control over to the operating system to complete
tasks in it's cache. when compled, control reverts back to the macro. in a
way, it's like pausing the macro so the operating system can "keep up".
sometimes you don't want this but sometimes not letting the operating system
perform it's thing causes problems. it's a macro to macro thing so if you are
experencing problems, the doevents may help. but then again maybe not. try it
and see.
can you say the word...troubleshoot?
also.....have you had your boss's IQ check lately?

regards
FSt1


"LuisE" wrote:

Thanks smartin

I know, 30 cmds ais too much but that's how my boss wants it.

Could you please ilustrate the use of DoEvents if possible?
Thanks

"smartin" wrote:

LuisE wrote:
I have a form with 30 command buttons that give a label certain value when
clicked

i.e
Private Sub Chk12_Click()
TxtLabel.Value = "12"
End Sub

The problem arises when sometimes it takes several clicks on the same button
to update the value of the label.

Thanks in advance for your help


Perhaps insert a well-placed "DoEvents".

Aside, an application with a form with 30 command buttons is crying for
an updated design.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default Command buttons not responding-sticking

Look for places in your code where loops might be consuming lots of CPU
time, and insert DoEvents:

For i = 1 to HugeNumber
DoEvents ' to update stuff before the CPU bust
' expensive calculation/sub/function call
' more stuff
' or put DoEvents here if you want to wait
' until the first iteration is complete
Next i


As concerns the way the boss wants it, this might be an opportunity to
impress your boss with a well designed UI that does not involve hunting
about for the right button to click (^:


LuisE wrote:
Thanks smartin

I know, 30 cmds ais too much but that's how my boss wants it.

Could you please ilustrate the use of DoEvents if possible?
Thanks

"smartin" wrote:

LuisE wrote:
I have a form with 30 command buttons that give a label certain value when
clicked

i.e
Private Sub Chk12_Click()
TxtLabel.Value = "12"
End Sub

The problem arises when sometimes it takes several clicks on the same button
to update the value of the label.

Thanks in advance for your help

Perhaps insert a well-placed "DoEvents".

Aside, an application with a form with 30 command buttons is crying for
an updated design.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Button not responding Rick Rothstein Excel Programming 1 January 14th 09 09:33 PM
Command Button not responding EAB1977 Excel Programming 0 January 14th 09 08:19 PM
Form buttons and Control Command Buttons ranswrt Excel Programming 0 August 7th 08 11:36 PM
windows excel &word 2003 pro save as command not responding Armando Robles V. Excel Discussion (Misc queries) 4 April 15th 06 10:37 PM
tab scrolling buttons not responding missdona Excel Worksheet Functions 0 September 14th 05 02:52 AM


All times are GMT +1. The time now is 09:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"