DoEvents??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have recently put a modal form onto a networked pc. The pc has its own
stand-alone version of Excel installed.

The form can take several minutes to complete and it has been reported that
very occasionally in the middle of completion, Excel crashes with a serious
error.

This is more likely if there has been an interuption during completion and
'several' minutes turns out to be 15 or even longer. (There is a Hide button
on the form for this reason and also to facilitate reference to other files.
I am reasonably confident this functionality does not cause conflicts)

When the form completes ok (great majority of occasions) and control is
released back to the application there is a period of several seconds when
the busy icon is visible and the pc 'catches up' with its 'housework'.

I have 2 questions:
1. Can the demands of a network 'intefere' with the running of a modal form?
For instance I know the network polls for emails every 30 minutes from a
central point elsewhere.
2. Should I be releasing control back to the application at various stages
during completion of the form by liberally using DoEvents?

T.I.A.

Geoff
 
Can the demands of a network 'intefere' with the running of a modal form?

There are a zillion things going on in a PC from moment to moment. The
system allocates processor time among them. When one has it the others
don't. But I've never noticed that my Excel apps are being shortchanged,

I don't think you can do that even if it was a good idea. When you Show a
modal userform your code is suspended until the user does something. You
can't run anything. If you think you're tying up the system have a look at
the Performance page of the Windows Task Manager with a userform up. To me
it looks like a waiting userform isn't very demanding at all.

--
Jim
|I have recently put a modal form onto a networked pc. The pc has its own
| stand-alone version of Excel installed.
|
| The form can take several minutes to complete and it has been reported
that
| very occasionally in the middle of completion, Excel crashes with a
serious
| error.
|
| This is more likely if there has been an interuption during completion and
| 'several' minutes turns out to be 15 or even longer. (There is a Hide
button
| on the form for this reason and also to facilitate reference to other
files.
| I am reasonably confident this functionality does not cause conflicts)
|
| When the form completes ok (great majority of occasions) and control is
| released back to the application there is a period of several seconds when
| the busy icon is visible and the pc 'catches up' with its 'housework'.
|
| I have 2 questions:
| 1. Can the demands of a network 'intefere' with the running of a modal
form?
| For instance I know the network polls for emails every 30 minutes from a
| central point elsewhere.
| 2. Should I be releasing control back to the application at various stages
| during completion of the form by liberally using DoEvents?
|
| T.I.A.
|
| Geoff
 
Hi
I'm clutching at straws. The form works without fault on other pcs which
are not networked. The difference is the networked pc runs on Office 2002
SP1 whereas mine is SP3. The other ok install runs on Office 2003.
I just don't know where the problem may lie and when the user mentioned the
fault was more likely to occur after an interupption I had to start thinking
of network or system delays, unlikely though that may be.

Geoff
 
I'm clutching at straws.

I feel your pain<g>. Sorry I couldn't be more helpful.

--
Jim
| Hi
| I'm clutching at straws. The form works without fault on other pcs which
| are not networked. The difference is the networked pc runs on Office
2002
| SP1 whereas mine is SP3. The other ok install runs on Office 2003.
| I just don't know where the problem may lie and when the user mentioned
the
| fault was more likely to occur after an interupption I had to start
thinking
| of network or system delays, unlikely though that may be.
|
| Geoff
|
| "Jim Rech" wrote:
|
| > >>Can the demands of a network 'intefere' with the running of a modal
form?
| >
| > There are a zillion things going on in a PC from moment to moment. The
| > system allocates processor time among them. When one has it the others
| > don't. But I've never noticed that my Excel apps are being
shortchanged,
| > much less crashing it.<g>
| >
| > >>Should I be releasing control back to the application at various
stages
| >
| > I don't think you can do that even if it was a good idea. When you Show
a
| > modal userform your code is suspended until the user does something.
You
| > can't run anything. If you think you're tying up the system have a look
at
| > the Performance page of the Windows Task Manager with a userform up. To
me
| > it looks like a waiting userform isn't very demanding at all.
| >
| > --
| > Jim
| > | > |I have recently put a modal form onto a networked pc. The pc has its
own
| > | stand-alone version of Excel installed.
| > |
| > | The form can take several minutes to complete and it has been reported
| > that
| > | very occasionally in the middle of completion, Excel crashes with a
| > serious
| > | error.
| > |
| > | This is more likely if there has been an interuption during completion
and
| > | 'several' minutes turns out to be 15 or even longer. (There is a Hide
| > button
| > | on the form for this reason and also to facilitate reference to other
| > files.
| > | I am reasonably confident this functionality does not cause conflicts)
| > |
| > | When the form completes ok (great majority of occasions) and control
is
| > | released back to the application there is a period of several seconds
when
| > | the busy icon is visible and the pc 'catches up' with its 'housework'.
| > |
| > | I have 2 questions:
| > | 1. Can the demands of a network 'intefere' with the running of a modal
| > form?
| > | For instance I know the network polls for emails every 30 minutes from
a
| > | central point elsewhere.
| > | 2. Should I be releasing control back to the application at various
stages
| > | during completion of the form by liberally using DoEvents?
| > |
| > | T.I.A.
| > |
| > | Geoff
| >
| >
| >
 
Use doevents to prevent hanging your system....

but use statics in your code to flag if the procces is already running
like this for a command button:


Code
-------------------
Static boolean AlreadyClicked

if Not Alreadyclicked
AlreadyClicked = true
'Do Your Stuff
Doevents
'do more stuff
Alreadyclicked = false
end i
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top