Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Show method stops macro

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,
--
Syed Zeeshan Haider



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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Show method stops macro

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





"Syed Zeeshan Haider" wrote in message
...
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,
--
Syed Zeeshan Haider



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




  #3   Report Post  
Posted to microsoft.public.excel.programming
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,


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Show method stops macro

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

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Show method stops macro

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!
--
Syed Zeeshan Haider



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




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Show method stops macro

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!
--
Syed Zeeshan Haider



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

"Don Guillett" wrote in message
...
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?

--
Don Guillett
SalesAid Software

"Syed Zeeshan Haider" wrote in message
...
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,
--
Syed Zeeshan Haider



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






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Show method stops macro

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)

"Syed Zeeshan Haider" wrote in message
...
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!
--
Syed Zeeshan Haider



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

"Don Guillett" wrote in message
...
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?

--
Don Guillett
SalesAid Software

"Syed Zeeshan Haider" wrote in message
...
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,
--
Syed Zeeshan Haider



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








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Show method stops macro

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


"Bob Phillips" wrote in message
...
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)

"Syed Zeeshan Haider" wrote in message
...
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!
--
Syed Zeeshan Haider



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

"Don Guillett" wrote in message
...
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?

--
Don Guillett
SalesAid Software

"Syed Zeeshan Haider" wrote in message
...
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,
--
Syed Zeeshan Haider



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










  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Show method stops macro

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 :-)

--
Regards
Frank Kabel
Frankfurt, Germany

"Syed Zeeshan Haider" schrieb im Newsbeitrag
...
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!
--
Syed Zeeshan Haider



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

"Don Guillett" wrote in message
...
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?

--
Don Guillett
SalesAid Software

"Syed Zeeshan Haider" wrote in message
...
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,
--
Syed Zeeshan Haider



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









  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Show method stops macro

"Frank Kabel" wrote in message ...

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!
--
Syed Zeeshan Haider



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

"Syed Zeeshan Haider" schrieb im Newsbeitrag
...
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!
--
Syed Zeeshan Haider



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

"Don Guillett" wrote in message
...
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?

--
Don Guillett
SalesAid Software

"Syed Zeeshan Haider" wrote in message
...
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,
--
Syed Zeeshan Haider



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









  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Show method stops macro

Hi
glad you found your error (and just to confirm: your time looks o.k.
now) :-)


--
Regards
Frank Kabel
Frankfurt, Germany

"Syed Zeeshan Haider" schrieb im Newsbeitrag
...
"Frank Kabel" wrote in message

...

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!
--
Syed Zeeshan Haider



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

"Syed Zeeshan Haider" schrieb im

Newsbeitrag
...
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!
--
Syed Zeeshan Haider



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

"Don Guillett" wrote in message
...
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?

--
Don Guillett
SalesAid Software

"Syed Zeeshan Haider" wrote in message
...
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,
--
Syed Zeeshan Haider



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










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
Opening a file stops a Macro Bob Myers Excel Worksheet Functions 2 January 8th 08 11:50 PM
Macro repeats and then stops Sabba Efie Excel Discussion (Misc queries) 2 August 15th 06 11:03 PM
Macro stops before beginning. y Excel Programming 7 April 12th 04 06:06 AM
macro stops midstream dvt[_2_] Excel Programming 3 February 23rd 04 03:46 PM
Macro stops when another workbook is open Robert McMahon Excel Programming 1 September 24th 03 10:26 PM


All times are GMT +1. The time now is 09:32 AM.

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

About Us

"It's about Microsoft Excel"