Excel: Auto Save Add-In Macro Halts If No Files Are Open

ID: Q76256


The information in this article applies to:
  • Microsoft Excel for Windows, versions 3.0, 4.0
  • Microsoft Excel for the Macintosh, versions 3.0, 4.0


SUMMARY

In Microsoft Excel for the Macintosh version 3.0, the Auto Save add-in macro included in the Microsoft Excel Library periodically saves all open files. You can activate the macro by opening Auto Save from the Macro Library folder. Auto Save functions correctly unless it attempts to save when there are no files open. In that case, the macro halts. You can avoid this problem by modifying the add-in macro with the following steps:

  1. From the File menu, choose Open and select Auto Save.


  2. Hold down the SHIFT key while choosing Open.


  3. From the Window menu, choose Unhide.


  4. Select Auto Save and choose the OK button.


  5. Select row 91 and from the Edit menu, choose Insert.


  6. Click cell B91 and type the following formula:
    
       =IF(ISERROR(DOCUMENTS(1)),GOTO(B102)) 


  7. From the File menu, select Save.



MORE INFORMATION

The error occurs because the Auto Save add-in macro does not check to see if any files are open before attempting to save all files. Adding the line above forces Excel to attempt to get a list of currently open files with the DOCUMENTS(1) function and cancels the macro if there are no files open.


REFERENCES

"Microsoft Excel User's Guide 2," version 4.0, pages 195-202
"Microsoft Excel User's Guide," version 3.0 for the Macintosh, Appendix B

Additional query words: 3.0 3.00 4.0 4.00

Keywords :
Version : MACINTOSH:3.0,4.0; WINDOWS:3.0,4.0
Platform : MACINTOSH WINDOWS
Issue type :


Last Reviewed: October 21, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.