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

Moving Section Breaks

Section breaks are used to divide a document into two or more sections that can be independently formatting. If you want ...

Discover More

Displaying Messages When Automatic Data Changes

It is possible to develop macros that update the information in your worksheets automatically. In such instances, you may ...

Discover More

Inserting Video into Worksheets

You can add all sorts of objects to your workbooks, including video clips. Here's the pros and cons (along with the ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Understanding Phantom Macros

When you delete all the macros in a workbook, Excel may still think you have some there. Here's why that happens and what ...

Discover More

Finding Workbooks Containing Macros

Workbooks can contain macros, or not. It is entirely up to you whether they do or not, but at some future time you might ...

Discover More

Reversing Names In Place

Do you want a way to reverse names within a cell, making them "last, first" instead of "first last?" Here's a handy macro ...

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 seven more than 1?

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.