Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Excel freezes while running macro

Hello,

I tried to find some threads that would cover this, but couldn't. So I'm running a find and replace macro with ~91000 search terms and a list of ~550000 from which to find them. Is it possible that even though task manager tells me that excell is "not responding", the macro is still running correctly? Task manager shows that excel is using all of one core out of two, and the used core seems to be switching now and then and the memory usage is not increasing. I know that if it is running correctly, it would take around 10-48 hours to complete, but if it's not running and only using resources, I rather would end the run now and try another approach.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default Excel freezes while running macro

"Arto Vesterbacka" wrote:
I tried to find some threads that would cover this, but couldn't.
So I'm running a find and replace macro with ~91000 search terms
and a list of ~550000 from which to find them. Is it possible that
even though task manager tells me that excell is "not responding",
the macro is still running correctly?


Sure. "Not responding" is misleading. It simply means that the Excel
window is not responding to internal window requests. This can happen
because the Excel or VBA thread is busy. Generally, the Excel thread does
not run when the VBA thread is running, except when the VBA thread makes a
request of the Excel thread (like the Find method).


"Arto Vesterbacka" wrote:
Task manager shows that excel is using all of one core out of two,
and the used core seems to be switching now and then and the memory
usage is not increasing.


That's your proof. Of course, it is possible that VBA or Excel is in an
internal infinite loop or otherwise stuck internally. In that sense, your
macro per se is not "still running" (making progress). That would be a
defect.

Since you have multiple cores, try pausing the macro. How to that varies
from computer to computer. On my computer, I press ctrl+Pause to stop as if
at a break point. I press ctrl+alt+Pause to get a message box with a choice
of Continue, End or Debug.

For the purpose of interrupting the macro at will, it might help if you
insert a statement so that you call to DoEvents occassionally, perhaps every
second ideally. But you do not want to incur the overhead of calling Timer
every iteration. Alternatively, you might determine how long a "typical" or
worst-case Find takes in your situation, then call DoEvents every few times
through the Find loop.

But in any case, VBA will not pause until Excel returns control from the
Find method.



I know that if it is running
correctly, it would take around 10-48 hours to complete, but if it's not
running and only using resources, I rather would end the run now and try
another approach.




--
Arto Vesterbacka


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
Excel Macro runs fine, but freezes if I try to do ANYTHING else whileit's running Rruffpaw Setting up and Configuration of Excel 0 August 3rd 11 08:31 PM
VBE freezes after running macros [email protected] Excel Programming 4 March 17th 10 08:26 AM
Simple Macro freezes the whole Excel and PC! Marco Margaritelli Excel Programming 5 June 6th 09 09:49 PM
Macro freezes up Excel Jon Delano Excel Programming 4 August 11th 05 07:54 PM
Macro freezes Excel Yohan[_2_] Excel Programming 4 February 17th 04 02:12 PM


All times are GMT +1. The time now is 05:28 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"