View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Show method stops macro

Hi Sved,

When you show a UserForm in Excel 97, Excel displays it as a *modal* form.
That means the calling code will stop executing until you hide the Userform
(or unload it). Typically, this is what you want anyway. You show a form,
the user interacts with the form, and when the user clicks OK or Cancel, you
hide the form and code execution continues.

If you need to continue executing code, you could put the code in the form's
Activate or Initialize event.

If you want to show a form modelessly (code continues to execute) natively
in Excel, you need to upgrade to at least Excel 2000. There are some
workarounds (look at "modelessform.zip" on Stephen Bullen's site
http://bmsltd.ie/Excel/Default.htm), however.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Syed Zeeshan Haider wrote:
Hello Experts,
I have Excel 97 Pro on Win98SE.

I have a certain piece of code in which UserForm1.Show stops the
macro? E.g.

Public Sub SomeProcedure()

' some working code here

UserForm1.Show ' After this line, the macro won't
proceed

' some should-work code here

End Sub

Why does UserForm1.Show stop the macro?
Is there any way to prevent it?

Thank you,