Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Running Macros in the Background.

Running Macros in the Background

Written by Allen Wyatt (last updated October 14, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003


1

When you run a macro in Excel, the program turns its full attention to completing the macro. (Sounds almost anthropomorphic, doesn't it?) This means that if the macro does quite a bit of heavy-duty processing of your data, it can seem as if your system has "locked up" during the processing of the macro.

Rest assured that the macro processing is only affecting Excel, however. You can open a different application and work within it while the macro chunks away in Excel in the background. Of course, the attention being paid to the macro by your system will probably slow down the response of the other program, but this depends on the version of Windows you are using on your system. The reason? Sharing of resources requires a process known as multitasking. Different versions of Windows handle multitasking in different ways.

You may wonder how you can do other work in Excel while the program is busy running a macro. Easy—just open another instance of Excel (run it again from your Start menu) and do some other work. All you need to do is make sure that you don't try to work on the same workbook (or workbooks) being utilized by the macros in your first instance of Excel.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2513) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Running Macros in the Background.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Renaming a File

Need to rename a file in a macro? It's easy to do using the Name command, as discussed in this tip.

Discover More

Adding Excel Information to a Web Page

Besides saving a worksheet as a complete Web page, you can also save smaller portions of your data to an existing Web ...

Discover More

Underlining Text in Cells

Want a quick way to add some underlines to your cell values? It's easy using the shortcuts provided in this tip.

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Deleting a File in a Macro

Macros give you a great deal of control over creating, finding, renaming, and deleting files. This tip focuses on this ...

Discover More

Creating a Photo Catalog from a Folder of Photos

Excel is great for collecting all sorts of information. You might even use it to create a catalog of your photos. Working ...

Discover More

Using SUM In a Macro

Want to use a worksheet function (such as SUM) from within a macro? Here's how easy it is to accomplish the task.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

2023-10-14 06:05:43

Barry

"running macros in background" implies the User wanting to do things in the foreground. Running a macro in background implies a long execution time for a macro or the macro is continually doing something (often waiting for some User input or a time based event).The DOEVENTS, ONKEY, ON TIME functions are common functions that allow the user to do things in foreground whilst a macro is running in background (by running it could mean just waiting for something for an event). Irrespective of which methodology is used the macro must be written to be cognisant that the the User may be doing things that might conflict with what the macro wants to do, or the User may change things that the macro has just changed causing a conflict between user and macro. With these things in mind Ibve successfully put together several solutions that provide this facility. The trickiest is using the DOEVENTS (as opposed to the macro just waiting) as the macro is actively doing stuff the the background that can directly interfer with what the User may doing in foreground.


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.