Show method stops macro

C

Chip Pearson

All forms in Excel97 are shown "modally" which means that the
calling code will stop at the Show method until the form is
hidden. Excel 2000 and later can show forms "modelessly" which
means that code execution proceeds after immediately after the
Show method, but there is no reliable way to do this in Excel 97.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
J

Jake Marx

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]
 
D

dmang

The macro stops because forms are "modal" in Office 97. While the for
is showing, only events on the form will be available (i.e butto
clicks, dropdown lists, etc..)
Once the form is hidden / closed the macro will continue at th
statement following Userform1.show

regards
d
 
D

Don Guillett

My computer shows your system clock may be off or is it possible you did it
on purpose to stay at the top of the list?
 
B

Bob Phillips

Syed,

Don's point was not off-topic. It is very bad etiquette to post the wrong
time, and be sitting on top of the pile for hours or days on end. Your first
reply was 11.5 hours before the question. This practice can obscures other
posts, and make us miss questions, as well as being boring (seeing the same
old post that has been answered sitting there).

As a regular responder, Don voiced what many of us were feeling, and he was
following our suggested etiquette by keeping it in the discussion.
Responding in this way is not the way to garner support for your next
question.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
S

Syed Zeeshan Haider

I am sorry, if I have hurt and I'll take care in future.

Now I got it! Somebody had disturbed the regional settings of my system.
Somebody had set the time zone to that of Canada. (You know kids. They like
to do experiments.) That's why there was a conflict of time. Next time I'll
take care of it and I hope it'll happen it again. If you had or somebody had
confirmed this problem earlier, I'd have resolved it much before.

Don, I apologize. I had assumed on my part that only you were facing the
problem.
No bad feelings!

Thanks!
--
Syed Zeeshan Haider



--------------------------------------------------
http://szh.20m.com
http://gomusharrafgo.20m.com


in message
 
F

Frank Kabel

Hi
to be honest I think the problem is on your side (something in your
time settings). Your post is 11 hours ahead. So somehow your
newsreader/etc is not set-up correctly

Please have a look at this as some/many people will simply delete these
kind of postings (as I do in most of the times)

On a sidenote: IMHO I think it was correct from Don to post this to the
NG :)
 
S

Syed Zeeshan Haider

to be honest I think the problem is on your side (something in your
time settings). Your post is 11 hours ahead. So somehow your
newsreader/etc is not set-up correctly

You are right.
Some kid had changed the time zone of my PC to that of Canada. That was
causing the problem. I checked it right after Bob told that he also was
facing this problem with my posts.
On a sidenote: IMHO I think it was correct from Don to post this to the
NG :)

Actually, I had assumed that only Don was facing that problem. I have
received many off-topic political responses on other NG's of VB that's why I
feel bad Abu dumping an excellent technical NG with political crap like some
amateur politicians do.

Thanks, Frank!
 
S

Syed Zeeshan Haider

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,
 
S

Syed Zeeshan Haider

Hi Don,
I depend a lot on my system clock, therefore, I never disturb it. I am in
Pakistan and it has been set according to Pakistan Standard Time. Outlook
Express is wise enough to convert other countries' time into PST (Pakistan
Standard Time).

Perhaps your computer's system clock is faulty or your newsreader's settings
are disturbed. Presence of a virus cannot be ruled out.

Anybody else on this for got this problem?

With due respect Don, please try to avoid off-topic questions or mail me
directly, if it is necessary. I was quite busy today with my project and I
had to complete it by evening. That's why I was very active on the forum.

Regards!
 
S

Syed Zeeshan Haider

Hi Chip, Jake and DM!

Thanks for the responses. After your replies, I have completed my project by
modifying my approach to the coding.

Actually, I wanted to display a progress bar which I designed by combining
two Label controls.

Thanks again!
 
Top