View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Luke Alcatel[_4_] Luke Alcatel[_4_] is offline
external usenet poster
 
Posts: 6
Default userform property change race

Thanks - that works. I had not known of the repaint function.

"Tim Williams" <timjwilliams at gmail dot com wrote in message
...
Have you tried refreshing the form (using Me.Repaint) after changing the
label ?

Tim


"Luke Alcatel" wrote in message
...
I have a msforms.listbox on a userform and I wrote code to sort rows of

the
list by column when I click a column heading. There are a few problems
that
I found by googling such as column headers are broken and they must be
created with labels on top of the list box but my code works. For a

large
table of several thousand rows I want to tell the user to "Wait" by
changing
the caption of a label on the form and then sorting but I found that the
caption changes after the sort completes rather than before. I have

code
lines to change the caption and call my sort function consecutively. If

I
single step the lines the caption changes first but when I execute
normally
the caption changes last.

My hypothesis is that underneath the hood there must be Windows message
passing going on and it looses a race to the start of my sort function
which
presumably dominates the interpreter unit it completes. How can I

insure
that the label caption will change first?

LA