Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Userform Shown while macro runs

I have a macro that runs over a few minutes. While its
running, I want to able to display a userform. I want the
form to have a cancel button which will stop the entire
routine.

When I initiate the macro its off the OKButton_Click
event. I call the form I want to see.

'Load StatusBar Userform
StatusBarUserform.Show

When I do this, the macro doesn't continue running. That
is, without this call stmt, the macro does its thing.
Here is just sits idle. Why does the act of showing this
form stop the macro from progressing? I want to see this
form and also have the code advance.

Then I want to be able to hit cancel and have all the
forms unload and hide

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform Shown while macro runs

StatusBarUserform.Show vbModeless

the default is to show in a modal mode - meaning it behaves as you describe.
Note that xl97 does not support the vbModeless argument. Its userforms are
modal. (using built in functionality).

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
I have a macro that runs over a few minutes. While its
running, I want to able to display a userform. I want the
form to have a cancel button which will stop the entire
routine.

When I initiate the macro its off the OKButton_Click
event. I call the form I want to see.

'Load StatusBar Userform
StatusBarUserform.Show

When I do this, the macro doesn't continue running. That
is, without this call stmt, the macro does its thing.
Here is just sits idle. Why does the act of showing this
form stop the macro from progressing? I want to see this
form and also have the code advance.

Then I want to be able to hit cancel and have all the
forms unload and hide

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Userform Shown while macro runs

So Tom, Put some ScreenUpdating commads around my hide
method for Userform1. It hid the form. However, when I
call the second form, only the form is shown. It is shown
white instead of its natural grey and its button is not
shown. Do I have to put in a separate command for the
button to show in modeless?

'Hide Main form
Application.ScreenUpdating = False
UserForm1.Hide
Application.ScreenUpdating = True

'Load StatusBar Userform
StatusBarUserform.Show vbModeless


-----Original Message-----
StatusBarUserform.Show vbModeless

the default is to show in a modal mode - meaning it

behaves as you describe.
Note that xl97 does not support the vbModeless argument.

Its userforms are
modal. (using built in functionality).

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote

in message
...
I have a macro that runs over a few minutes. While its
running, I want to able to display a userform. I want

the
form to have a cancel button which will stop the entire
routine.

When I initiate the macro its off the OKButton_Click
event. I call the form I want to see.

'Load StatusBar Userform
StatusBarUserform.Show

When I do this, the macro doesn't continue running.

That
is, without this call stmt, the macro does its thing.
Here is just sits idle. Why does the act of showing

this
form stop the macro from progressing? I want to see

this
form and also have the code advance.

Then I want to be able to hit cancel and have all the
forms unload and hide

Thanks




.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform Shown while macro runs

Application.ScreenUpdating = True
UserForm1.Hide
'Load StatusBar Userform
StatusBarUserform.Show vbModeless
doevents
Application.ScreenUpdating = False

Might work - hard to tell.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
So Tom, Put some ScreenUpdating commads around my hide
method for Userform1. It hid the form. However, when I
call the second form, only the form is shown. It is shown
white instead of its natural grey and its button is not
shown. Do I have to put in a separate command for the
button to show in modeless?

'Hide Main form
Application.ScreenUpdating = False
UserForm1.Hide
Application.ScreenUpdating = True

'Load StatusBar Userform
StatusBarUserform.Show vbModeless


-----Original Message-----
StatusBarUserform.Show vbModeless

the default is to show in a modal mode - meaning it

behaves as you describe.
Note that xl97 does not support the vbModeless argument.

Its userforms are
modal. (using built in functionality).

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote

in message
...
I have a macro that runs over a few minutes. While its
running, I want to able to display a userform. I want

the
form to have a cancel button which will stop the entire
routine.

When I initiate the macro its off the OKButton_Click
event. I call the form I want to see.

'Load StatusBar Userform
StatusBarUserform.Show

When I do this, the macro doesn't continue running.

That
is, without this call stmt, the macro does its thing.
Here is just sits idle. Why does the act of showing

this
form stop the macro from progressing? I want to see

this
form and also have the code advance.

Then I want to be able to hit cancel and have all the
forms unload and hide

Thanks




.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs Rruffpaw Setting up and Configuration of Excel 1 September 17th 11 01:25 PM
One macro runs then it auto runs another macro PG Excel Discussion (Misc queries) 2 September 1st 06 09:30 PM
Userform runs other subs when initialized zipdog Excel Programming 3 February 2nd 05 04:04 PM
Keping a UserForm open as VBA runs Chris Gorham[_3_] Excel Programming 3 December 26th 03 09:02 PM
Excel: VBA userform is shown but not loaded/initialized even though it was first unloaded? Luisa[_2_] Excel Programming 2 December 5th 03 08:15 AM


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"