label.refresh error

B

beerora

I attached a label control in a worksheet.
I change the caption of label by vba. This is my code:

sub refreshLabel()
With Activesheet
.label1.caption= strMsg
.label1.refresh
end with
end sub


But I got run time error says that object doesn't support
laebl.refresh property.

So.. I tried another way. The code is:
sub refreshLabel()
With Activesheet
.label1.caption= strMsg
doevents
end with
end sub

DoEvents not update too.

Why excel behaves for above 2 cases?
Thanks for the help

Cheers
 
B

Bob Phillips

Just remove that line, it is not necessary.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top