Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Command Button not responding | Excel Programming | |||
Command Button not responding | Excel Programming | |||
Form buttons and Control Command Buttons | Excel Programming | |||
windows excel &word 2003 pro save as command not responding | Excel Discussion (Misc queries) | |||
tab scrolling buttons not responding | Excel Worksheet Functions |