Odd behavior

O

Otto Moehrbach

Excel XP & Win XP
I have 2 workbooks.
One wb is open, the other closed.
They both have the same exact code and lots of it, except for one additional
module in the open wb.
I run the code in that one module in the open wb.
The object is to update worksheet data in the open wb from the closed wb.
The problem I am describing occurs when the closed wb is opened.
I step through the code (F8).
I get to the following code:
Application.EnableEvents = False
Set wbFile2 = Workbooks.Open(ThePath & TheFile)
Application.EnableEvents = True
and the screen starts jumping around with visual effects. Pieces of scroll
bars, title bars, etc appear and disappear virtually everywhere on the
screen. Finally, all this action stops and the closed file is now open.
My question: What is happening and why and is this a problem? Thanks for
your time. Otto
 
J

JRForm

Sounds like a resource issue (memory). The screen in not able to be redrawn
because back ground jobs are running (opening file, clip board operations,
services). Are you trying to copy a large amount of data ot the closed wb?
 
O

Otto Moehrbach

I was stepping through the code. At the point in the code when all the
jumping around was happening all that was happening in the code was the
opening of the one file. No copying/pasting was taking place. I have 3/4
gig of memory and each file is about .8 megs. One file was open and the
other was being opened. Thanks for your time. Otto
 
J

JRForm

Otto,

Even though you may have been stepping through the code, the resources
available on your pc are stretched. Excel code can stress the memory by
storing values in memory as well as other applications that could be running
at the time (virus scanner). Do you get the same result each time you run
the code?
 
O

Otto Moehrbach

Yes, identical. Since this project is just a one-time thing, I worked
around the problem by telling the user that both files must be open before
running the code. Then I changed the code to not open that second file.
But it still bothers me that Excel would behave like that and I don't know
why. Thanks again. Otto
 

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

Top