XL: AutoSave Command Recorded in Subroutine or Macro

Last reviewed: February 2, 1998
Article ID: Q120871

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

SYMPTOMS

In Microsoft Excel, if you record a Visual Basic for Applications macro or a Microsoft Excel version 4.0 macro while the AutoSave add-in is functioning, and the AutoSave add-in displays a prompt to save a file while you are recording, one of the following lines of code is recorded in your subroutine.

   Microsoft Excel 98 Macintosh Edition
   ------------------------------------

   Application.Run Range("'Auto Save'!mcs02.OnTime")   

   Microsoft Excel 97
   ------------------

   Application.Run Range("AUTOSAVE.XLA!mcs02.OnTime")


   Microsoft Excel for Windows, version 5.0 and
   Microsoft Excel for Windows 95, version 7.0
   --------------------------------------------

   Visual Basic for Applications:
      Application.Run Macro:=Range("AUTOSAVE.XLA!mcs02.OnTime")

   MS Excel 4.0:
      =RUN("AUTOSAVE.XLA!mcs02.OnTime",FALSE)

   Microsoft Excel for the Macintosh, version 5.0
   ----------------------------------------------

   Visual Basic for Applications:
     Application.Run Macro:=Range("'Auto Save'!mcs02.OnTime")

   MS Excel 4.0:
       =RUN("'Auto Save'!mcs02.OnTime",FALSE)

CAUSE

This occurs because the macro recording system in Microsoft Excel is aware of macros that are assigned to run at a certain time (for instance "ON.TIME macros"). If such a macro runs while the macro recorder is operating, the command to run that macro is recorded.

WORKAROUNDS

To work around this problem, do either of the following:

  • Once you have finished recording your macro, remove or comment out any commands that should not be contained in the macro.

        -or-
    
  • Before starting to record a new subroutine or macro, disable any ON.TIME macros that are present.

For example, to disable AutoSave in Microsoft Excel 97 and Microsoft Excel 98, follow these steps:

  1. On the Tools menu, click AutoSave.

  2. In the AutoSave dialog box, clear the "Automatic Save Every" check box.

  3. Click OK to accept the change.

To disable AutoSave in Microsoft Excel version 5.0, follow these steps:

  1. On the Tools menu, click AutoSave.

  2. In the AutoSave dialog box, clear the "Automatic Save" check box.

  3. Click OK to accept the change.

STATUS

This behavior is by design of Microsoft Excel.


Additional query words: 5.00 5.00c 7.00 7.00a 97 98 XL98 XL97 XL7 XL5
Keywords : kbcode kbmacro
Version : WINDOWS:5.0,5.0c,7.0,97; MACINTOSH:5.0,98
Platform : MACINTOSH WINDOWS


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.