Excel Macro Not Responding? Fix It Safely

VBA & macros · Updated November 21, 2026

If an Excel macro is not responding, first give it a little time if Excel is still using CPU or updating data; a large calculation or import can take several minutes. If it appears stuck, try Ctrl+Break on Windows to interrupt the VBA procedure, then investigate the code, workbook, add-ins, and calculation settings before running it again.

First, decide whether Excel is busy or frozen

The message Not Responding does not always mean Excel has stopped working. Windows may display it when Excel is not processing messages from the desktop while VBA performs a long operation. A macro that reads thousands of cells one at a time, refreshes external data, or recalculates a large model can make the window appear frozen even though the task is progressing.

Look for signs of activity before forcing Excel to close. The Excel process may continue using CPU or memory in Task Manager, and the workbook may eventually update or return to normal. A macro that reports progress in the status bar or writes results in batches can also provide clues, although many macros show no visible progress. If resource use stays near zero and the same window remains unresponsive for a long time, a loop, dialog hidden behind another window, or blocked external connection may be involved.

  • Wait longer for a known large calculation, import, or refresh than you would for a small formatting macro.
  • Check whether Excel is waiting for a prompt, such as a security warning or a confirmation dialog that is behind another window.
  • Avoid repeatedly clicking the workbook or starting the macro again. Extra clicks can queue actions or make recovery harder.

There is no universal wait time that proves a macro is stuck. The file size, computer, network, data source, and macro design all affect how long a legitimate task takes.

How to interrupt a running macro

On Excel for Microsoft 365 on Windows, press Ctrl+Break to request an interruption. Depending on what VBA is doing, Excel may show a dialog offering to end the macro or enter Debug mode. Choose End if you want to stop it, or Debug if you want to inspect the paused line in the Visual Basic Editor. On some keyboards, the Break key is combined with another key; the required key combination varies by keyboard manufacturer.

Esc can cancel some Excel operations, but it is not a dependable way to stop arbitrary VBA code. A macro that is executing a long, uninterrupted VBA loop may not respond to Esc or Ctrl+Break immediately. If the code is waiting for a database, network location, or another application, Excel may only regain control when that operation completes or times out. On Excel for Mac, Command+Period is the usual interruption shortcut for a running macro; keyboard layouts and the operation in progress can affect whether the interruption is accepted.

If the Visual Basic Editor opens in Debug mode, the highlighted line is where execution paused, not necessarily the original cause. Read the surrounding code before continuing. Avoid using the Reset button or choosing End casually: stopping a macro partway through can leave partially updated cells, open files, disabled events, or altered calculation settings. A macro cannot be undone with Ctrl+Z. For that reason, save a separate copy of the workbook before running unfamiliar code whenever possible.

Common reasons a macro becomes unresponsive

Slow code is a frequent cause. Repeatedly selecting cells, switching worksheets, or writing one cell at a time creates extra work. Recalculating formulas after each change can multiply the delay. A loop that never reaches its exit condition, or that keeps processing the same records, can make the workbook appear permanently stuck.

Other causes are outside the macro itself. A workbook may contain complex formulas, volatile functions, pivot tables, links to other files, or large data ranges that need recalculation. The macro may be refreshing a query, waiting for a network file, or automating another Office application. An add-in can also interfere with Excel or consume resources. Finally, a macro may display a message box or request input while its dialog is hidden behind Excel or another window.

  • Code or logic: an endless loop, an incorrect range, or inefficient cell-by-cell processing.
  • Workbook workload: formula recalculation, large tables, links, charts, or pivot refreshes.
  • External dependencies: a slow network share, database, web query, or application controlled by VBA.
  • Excel environment: an add-in, damaged workbook, limited available memory, or an outdated Office installation.

Macro security is a separate issue. A blocked or disabled macro usually does not start at all; it is not the same as a macro that begins running and then stops responding. Do not lower macro security or enable all macros as a troubleshooting shortcut. Only run code from a source you trust.

Check whether the workbook or an add-in is responsible

After closing Excel normally, if possible, reopen it without immediately running the problem macro. Test whether ordinary actions such as opening a blank workbook and entering a value work normally. If Excel is slow even without the macro, the problem may involve the installation, an add-in, the computer, or the workbook environment rather than that procedure alone.

On Windows, you can launch Excel in Safe Mode by pressing Windows key+R, typing excel /safe, and pressing Enter. Safe Mode starts Excel without most add-ins and customizations. If Excel behaves normally there, an add-in or customization is a useful suspect. To review add-ins in a regular Excel session, use File > Options > Add-ins. At the bottom, choose Excel Add-ins or COM Add-ins in the Manage box, select Go, and disable an item temporarily. Restart Excel and test again. Re-enable items one at a time to identify a possible conflict.

Safe Mode is a diagnostic step, not a repair by itself, and it does not prove that a particular add-in is faulty. On Mac, do not use the Windows /safe launch command; review Excel add-ins through Excel’s available add-in controls and test with them disabled. If only one workbook causes the slowdown, compare a copy of that file with a new workbook before making changes to the original.

Inspect the macro and reduce avoidable work

If you can access the code, identify the slow section by running a copy and using the Visual Basic Editor’s Debug tools to step through or set a breakpoint. A breakpoint pauses execution at a selected line, making it easier to learn whether the delay comes from a loop, worksheet operation, calculation, or external call. Work on a copy: debugging can alter the workbook just as running the macro can.

For large data tasks, VBA is generally more efficient when it reads a range into an array, processes values in memory, and writes results back in a batch than when it repeatedly selects cells and changes them individually. Code should refer directly to worksheets and ranges rather than relying on whichever sheet happens to be active. Check loop boundaries and conditions, especially when the last row or input range can vary. If the macro uses a loop, confirm that its counter or exit condition changes on every pass when appropriate.

Macros sometimes turn off screen updating, events, or automatic calculation to improve speed. Those settings should be restored even if an error occurs. If a macro stops while events are disabled, for example, other workbook actions may behave unexpectedly until the setting is restored or Excel is restarted. Do not change these settings at random to try to unfreeze a macro; first determine what the code is doing. Adding DoEvents can let Excel process some queued events during a loop, but it should be used carefully because other actions can occur while the macro is paused.

Review calculation, refreshes, and external links

A macro that writes many values can trigger repeated formula calculations, making a workbook much slower than expected. In Excel for Windows, check the calculation setting at Formulas > Calculation Options. If it is set to Automatic, formulas may recalculate as changes occur; switching to Manual can reduce repeated recalculation in some workflows, but formula results may then remain out of date until you calculate them. Restore the intended setting after testing, and do not assume that manual calculation is safe for a workbook used by others.

Data refreshes can take time for reasons unrelated to VBA. Check whether a query or linked workbook depends on a network connection, credentials, or a remote service. If a macro starts a refresh and then immediately reads the results, its behavior may depend on whether the refresh runs synchronously or in the background. A network interruption can make the wait look like a VBA freeze. Test a copy with the external source available and compare the result with a local, small sample where appropriate.

Large formulas and volatile calculations can also make every macro write expensive. A workbook with many formulas referencing entire columns may recalculate far more cells than the macro changes. The right fix is often to narrow ranges or improve workbook design, not to repeatedly stop and restart Excel. If you adjust calculation mode, record the original setting and verify formula results afterward.

Recover safely if Excel remains stuck

If the interruption shortcut does nothing and Excel remains unresponsive, give any active save, refresh, or calculation a reasonable chance to finish before ending the process. Closing Excel through Task Manager can discard unsaved changes and may leave the last macro run incomplete. If you must force-close it, use Task Manager on Windows, then reopen Excel and look for the Document Recovery pane or recovered workbook. Recovery is not guaranteed, especially for changes made since the most recent saved or recovered version.

AutoRecover and AutoSave are not identical. AutoRecover can preserve recovery information at intervals, depending on the Excel settings and file type. AutoSave is associated with supported files stored in OneDrive or SharePoint and does not make every macro action reversible. Check File > Options > Save in Windows Excel for AutoRecover settings. After recovery, save the recovered file under a new name and compare important sheets with the last known-good copy.

Before running the macro again, identify what it may have changed. It could have written only some rows, refreshed some data, or altered workbook settings before stopping. A separate backup, version history for a cloud-stored file, or a known-good source copy is safer than assuming a partial run left the workbook untouched.

Excel for the web and Mac differences

Excel for the web cannot run VBA macros. If a workbook contains VBA, open it in the desktop Excel app to run or debug that code. Excel for the web may allow you to view or edit workbook data, but it is not a substitute for the desktop VBA environment. Office Scripts are a different automation feature and are not simply another way to run the same VBA macro.

Excel for Mac supports VBA, but menus, add-in management, and keyboard layouts differ from Windows. Use the Mac interruption shortcut Command+Period when applicable, and consult the Mac version’s ribbon or menus rather than following Windows-only paths literally. If a macro automates a Windows-specific component, file path, or application, it may need changes to work on Mac even when its ordinary worksheet code is valid.

Frequently Asked Questions

How long should I wait when Excel says Not Responding?
There is no fixed limit. Wait longer for a known large import, refresh, or calculation, and look for continued resource use or visible progress. If a small macro stays stuck with no signs of activity, try to interrupt it and investigate rather than repeatedly clicking Run.

Can I stop an Excel macro without closing the workbook?
Usually, try Ctrl+Break on Windows or Command+Period on Mac. Excel may offer an option to end or debug the procedure. These shortcuts cannot interrupt every blocked external operation immediately, and stopping the macro may leave partial changes.

Why does Ctrl+Z not undo what the macro changed?
Running VBA generally clears Excel’s normal Undo history. Once a macro has changed cells, Ctrl+Z cannot reliably reverse those changes. Use a saved copy, backup, or version history to recover the earlier state.

Does a blocked macro cause Excel to say Not Responding?
Usually, a blocked macro is prevented from running and Excel shows a security warning or disables the content. Not Responding more often means Excel is busy, waiting, or stuck after execution began. Only enable code from a trusted source.

Will reinstalling Excel fix a macro that freezes?
Not necessarily. A problem limited to one workbook or one procedure is more likely to need investigation of its code, data, links, or settings. Test Excel in Safe Mode and with a blank workbook first; consider repairing Office only if broader Excel problems persist.

Related

Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.

More in VBA & macros

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.