Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form label not updating immediately
I have a simple form with 2 command buttons and several labels.
CommandButton2 simply closes the file (Cancel). This works OK. CommandButton1 calls some code in a worksheet within the same workbook. This code is intended to work in the background with the form still visible in front. This part works. This works OK. Label7 is not visible initially and I want it to become visible as soon as CommandButton1 is clicked. The label does not appear for several seconds after clicking the button. I added the timer to try to give the label time to be displayed before moving on, but much of the called code has processed before the label appears. As the label simply asks the user to wait while the code runs, this isn't a lot of use. Any ideas? -- Ian -- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form label not updating immediately
CommandButton1_Click()
me.Label7.visible = true me.Label7.Caption = "Processing..." 'Call your procedure here End Sub The first two lines of the procedure should make the label visible and update the caption property. Doing this before calling any other code should resolve the isseue. However, ditching the label all together and updating the userforms caption property could also be an option. "IanC" wrote: I have a simple form with 2 command buttons and several labels. CommandButton2 simply closes the file (Cancel). This works OK. CommandButton1 calls some code in a worksheet within the same workbook. This code is intended to work in the background with the form still visible in front. This part works. This works OK. Label7 is not visible initially and I want it to become visible as soon as CommandButton1 is clicked. The label does not appear for several seconds after clicking the button. I added the timer to try to give the label time to be displayed before moving on, but much of the called code has processed before the label appears. As the label simply asks the user to wait while the code runs, this isn't a lot of use. Any ideas? -- Ian -- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form label not updating immediately
Hi Jeff
It's not made any difference. I already had Label7.Visible = True. I've changed this to Me.Label7.Visible = True and added the caption line but it doesn't help. If I extend the time delay, the delay before the label appears also increases. In other words, the label always seems to appear at around the same point in the called code exectution. I tried adding a break point at various points in the code, but the only thing I could determine from that is that the label appears as soon as the breakpoint is reached, wherever I put it! My code is below. Private Sub CommandButton1_Click() Dim x ' "Start updates" button Me.Label7.Visible = True Me.Label7.Caption = "Updating..." x = Now() While Now() < x + TimeValue("0:00:02") Wend Call Worksheets("Update list").update End Sub "Jeff" wrote in message ... CommandButton1_Click() me.Label7.visible = true me.Label7.Caption = "Processing..." 'Call your procedure here End Sub The first two lines of the procedure should make the label visible and update the caption property. Doing this before calling any other code should resolve the isseue. However, ditching the label all together and updating the userforms caption property could also be an option. "IanC" wrote: I have a simple form with 2 command buttons and several labels. CommandButton2 simply closes the file (Cancel). This works OK. CommandButton1 calls some code in a worksheet within the same workbook. This code is intended to work in the background with the form still visible in front. This part works. This works OK. Label7 is not visible initially and I want it to become visible as soon as CommandButton1 is clicked. The label does not appear for several seconds after clicking the button. I added the timer to try to give the label time to be displayed before moving on, but much of the called code has processed before the label appears. As the label simply asks the user to wait while the code runs, this isn't a lot of use. Any ideas? -- Ian -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenate to form a label | Excel Discussion (Misc queries) | |||
Hyperlink on a label in a VB Form | Excel Discussion (Misc queries) | |||
Form label not showing | Excel Programming | |||
COPY LABEL FORM FROM EXCEL TO A LABEL | New Users to Excel | |||
Disable Label in a Form | Excel Programming |