View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jeff Jeff is offline
external usenet poster
 
Posts: 921
Default 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
--