Excel – How to keep Microsoft Excel running at full speed even when it does not have the window focus

microsoft excelmicrosoft-officepriority

I've noticed that when Excel 2007 (and probably earlier versions) has the window focus, Excel runs at full speed which means that files open fast and long-running VBA macros execute quickly.

If the Excel window loses the focus, the thread priority of Excel seems to drop dramatically and large files that were opening when you moved the focus open sluggishly, and complex VBA macros take a long time to complete.

Is there any way to keep the Excel priority high regardless of whether it is focused or not?

I know I could boost the thread priority artificially through Task Manager but I'm not sure what knock-on effects this might have for my spreadsheets, or OS.

My system is a fast Dual Core with 4Gb RAM and is running Vista 64.

EDIT FOR CLARIFICATION:

My problem is not simply about raising the priority of the Excel process through Task Manager because this only affects Excel when it has the window focus.

The point is what happens when Excel loses the window focus.

From using Excel extensively, it appears that, by design, it deliberately lowers its own process priority when the Excel window does not have focus.

Setting a higher priority for the Excel process does not stop this from happening – it only gives Excel a higher process priority when it has the focus but it still dips dramatically when it loses focus.

In normal Excel usage (probably 99% of everyone using it), you wouldn't notice this effect but with a massive spreadsheet (around 2000 worksheets, I think) and complex VBA Macros that take a few minutes to execute, the effect is very noticeable.

Ideally, I need it to keep the same thread priority regardless of whether the Excel window is focused.

Up to now, I have just been sitting back from the computer for a few minutes during processing so that I don't accidentally click off the Excel window when it is crunching away but I was just hoping there was a better solution…perhaps a registry hack of some kind?

EDIT:

I have only ever found one other mention of this issue on the net at this link

This is the relevant quote…

However, if I make the Excel 2000
window visible to the user and also
keep the window in focus, the macros
execute with their expected speed.
Again, the window must have focus or
the macro slows to a crawl again.

Best Answer

Windows non-server editions, by default, provide a priority boost to the foreground process. When you push Excel to the background, it loses out on the boost it previously had being in the foreground; some other program instead gains the priority boost.

You can change a setting so that programs no longer get this boost. Note: This won't affect just Excel, but any program that would have otherwise qualified for a boost.

Here's how to tweak the setting in Windows XP:

  1. Right-click My Computer.
  2. Choose Properties.
  3. Click the Advanced tab.
  4. In the Performance panel, click the Settings button.
  5. Click the Advanced tab. The first panel is Processor Scheduling:

    Processor Scheduling panel

  6. Change it from the default of "Programs" to "Background services" and it should cause Excel to behave closer to the way you want when it's in the background.

Related Question