I first encountered this problem in Excel2007.
Not at all in Excel2003.

What I discovered is that it seems to be a  Windows Priority issue.
(Possibly an XP issue after all!)

What seems to happen is that while the macro is running, 
and nothing else is going on, Excel is the "highest" priority
for the CPU... but when you select another window, Windows
thinks that what YOU are doing MUST be more important than
any old macro that could just as easily do it's job in the "background",
so Windows reduces the priority of Excel and gives you
more CPU cycles.

Your macro probably isn't "freezing", it simply is running
v.e.r.y s.l.o.w.l.y...

I have a macro file with over 4000 lines of code.
For 3+ years, it ran consistently every day for 42-45 minutes.
Then, my machine was "upgraded" to Office 2007.
The first time the program ran, it ran for 4 hours.
The next time, it was almost 6.
I searched the Internet and discovered the solution.

First, to determine if this is the problem, try this:

While the macro is running, hit ctrl-alt-del and open the Task Manager.
Select the Processes tab.
Locate the Excel process (you may want to click the "image name" column to sort)
right-click the Excel.exe process
move to "Set Priority" and change it to "High".

The macro should now run normally.

The problem with doing this, is that it's a pain to do every time!
With the help of other masterminds of the internet, I managed to 
create a macro that runs when I open my workbook that will
automatically set the Priority to "High".
 

If the previous change to the Priority fixes your problem, let me know and  
I'll 
post the macro.

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------




________________________________
From: Rruffpaw <shara...@hotmail.com>
To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com>
Sent: Wed, August 3, 2011 3:32:23 PM
Subject: $$Excel-Macros$$ VBA macro runs fine, but freezes if I try to do 
ANYTHING else while it's running

I have a very large Excel spreadsheet (13 MB) with several macros. One
of them runs a loop with multiple commands.

The macro runs fine, as long as I sit back and just watch it run. If I
click on another window however, it invariably freezes and I have to
terminate Excel.

Any ideas on how I can remedy this?

I'm running Excel 2003 on Windows XP, but have noticed the same
problem with the same spreadsheet on a machine running Excel 2007,
also on Windows XP.

Thanks

-Sharat

-- 
----------------------------------------------------------------------------------

Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to