XL: No Resume Button or Key Command for Paused .XLM Macro

Last reviewed: February 2, 1998
Article ID: Q105543

The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a
  • Microsoft Excel 97 for Windows
  • Microsoft Excel 98 Macintosh Edition

SYMPTOMS

In Microsoft Excel versions 5.0 and later, you cannot restart a paused Microsoft Excel 4.0 (.XLM) macro if you do not have a mouse. Additionally, when your macro pauses, there is no Resume command available, and the Resume Macro button is not automatically displayed to resume your paused macro.

CAUSE

In versions of Microsoft Excel earlier than 5.0, you can click Resume on the Macro menu to restart a paused .XLM macro. You can also click the Resume button on the Macro Paused toolbar that automatically appears when your macro is paused.

However, these options are not available in Microsoft Excel versions 5.0 and later.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/default.asp

NOTE: It is not possible to restart a paused .XLM macro if you do not have a mouse. In this case, you must exit Microsoft Excel in order to terminate the macro.

To restart a paused .XLM macro, you must use the Resume Macro button located on the Visual Basic toolbar. You can do this by using either of the following methods:

Method 1

If the Visual Basic toolbar is not visible on the screen when your macro is paused, you will need to display it before you can restart your macro. To display the Visual Basic Toolbar, do the following:

  • In Microsoft Excel 5.0 and 7.0, click Toolbars on the View menu. In the Toolbars list, select the Visual Basic check box. Click OK to display the Visual Basic toolbar.
  • In Microsoft Excel 97 or Microsoft Excel 98, click the View menu, point to Toolbars, and then click Visual Basic.

Method 2

Another method for displaying the Resume Macro button in Microsoft Excel 5.0 and 7.0 is to create a new toolbar that contains the Resume Macro button, and then modify your macro to display and hide the toolbar. To use this method, follow these steps:

  1. In the workbook that contains your macro, click Toolbars on the View menu. In the Toolbar Name box, type "Macro Paused" (without quotation marks) and click New.

2 In the Categories list, select Macro. Drag the Resume Macro button (||)
   from the Buttons group to the new toolbar. Close the Customize dialog
   box.

  • On the Insert menu, point to Macro, and then click Module. On the Tools menu, click Attach Toolbars.

  • In the Custom Toolbars list, select Macro Paused. Click Copy to add Macro Paused to the Toolbars In Workbook list. In the Attach Toolbars dialog box, click OK.

  • On the Edit menu, click Delete Sheet to remove the empty module sheet from your workbook.

    The Macro Paused toolbar is now contained in the workbook.

    To use the Macro Paused toolbar in your macro, modify your macro using the following commands to display and hide the Macro Paused toolbar:

       A1: =SHOW.TOOLBAR("Macro Paused",TRUE)
       A2: =PAUSE()
       A3: =SHOW.TOOLBAR("Macro Paused",FALSE)
    
    

    Explanation of the Macro

       A1: This command displays the Macro Paused toolbar
       A2: This command pauses your macro
       A3: This command hides the Macro Paused toolbar when the macro is 
           resumed
    
    

    REFERENCES

    "User's Guide," version 5.0, page 632


  • Additional query words: 5.00 5.00c 7.00 7.00a XL98 XL97 XL7 XL5 pause()
    Keywords : kbcode kbprg kbprb PgmOthr
    Version : WINDOWS:5.0,5.0c,7.0,97; MACINTOSH:5.0,98
    Platform : MACINTOSH WINDOWS
    Issue type : kbprb
    Solution Type : kbworkaround


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: February 2, 1998
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.