PC Review


Reply
Thread Tools Rate Thread

Code stops while Userform Shown

 
 
ExcelMonkey
Guest
Posts: n/a
 
      8th May 2009
I have some code which shows a userform. While the form is shown I want to
run through a lenthy routine and periodocially update a label with status
strings. However, once the userform is shown, the code stops progressing. I
can only get the code to progress if I close the form. It almost as if I
have set break in the code on the first line after the Userform1.Show
statement. Any ideas?


Sub DoSomething()
Userform1.Show

Call DoSomethingElse

End Sub

Call DoSomethingElse
Userform1.Label1 = "Show something"
End Sub

Thanks

EM
 
Reply With Quote
 
 
 
 
ExcelMonkey
Guest
Posts: n/a
 
      8th May 2009
Duh. Needed to ste ShowModal = False to make modeless.

Thanks

EM

"ExcelMonkey" wrote:

> I have some code which shows a userform. While the form is shown I want to
> run through a lenthy routine and periodocially update a label with status
> strings. However, once the userform is shown, the code stops progressing. I
> can only get the code to progress if I close the form. It almost as if I
> have set break in the code on the first line after the Userform1.Show
> statement. Any ideas?
>
>
> Sub DoSomething()
> Userform1.Show
>
> Call DoSomethingElse
>
> End Sub
>
> Call DoSomethingElse
> Userform1.Label1 = "Show something"
> End Sub
>
> Thanks
>
> EM

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      8th May 2009
The way to do that and make your code self-documenting is to use the
built-in VB constant...

Userform1.Show vbModeless

--
Rick (MVP - Excel)


"ExcelMonkey" <(E-Mail Removed)> wrote in message
news:2EF1FD27-8428-4F3A-9832-(E-Mail Removed)...
> Duh. Needed to ste ShowModal = False to make modeless.
>
> Thanks
>
> EM
>
> "ExcelMonkey" wrote:
>
>> I have some code which shows a userform. While the form is shown I want
>> to
>> run through a lenthy routine and periodocially update a label with status
>> strings. However, once the userform is shown, the code stops
>> progressing. I
>> can only get the code to progress if I close the form. It almost as if I
>> have set break in the code on the first line after the Userform1.Show
>> statement. Any ideas?
>>
>>
>> Sub DoSomething()
>> Userform1.Show
>>
>> Call DoSomethingElse
>>
>> End Sub
>>
>> Call DoSomethingElse
>> Userform1.Label1 = "Show something"
>> End Sub
>>
>> Thanks
>>
>> EM


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm Shown while Program is Running other Code ironhydroxide Microsoft Excel Programming 1 3rd Aug 2009 11:07 PM
Userform moves when hidden and shown again. =?Utf-8?B?RGFsZSBGeWU=?= Microsoft Excel Programming 6 24th Oct 2007 01:53 PM
UserForm initialize event run when UserForm is shown dmgathmann@gmail.com Microsoft Excel Programming 2 13th Jun 2007 02:49 AM
Using Cells while UserForm shown =?Utf-8?B?VF9vX25feQ==?= Microsoft Excel Programming 8 3rd Feb 2007 09:39 PM
Userform to enter values and shown in same userform in list helmekki Microsoft Excel Programming 0 19th Nov 2005 03:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 AM.