XL5: Unexpected Results Using ExecuteExcel4Macro with CLOSE()

Last reviewed: March 27, 1997
Article ID: Q123442
5.00 5.00c 7.00 WINDOWS kbprg kbmacro kbcode

The information in this article applies to:

  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

When you call an Excel 4 macro from a Visual Basic, Applications Edition, procedure using the Application.ExecuteExcel4Macro command, the strings "FILE.CLOSE()" and "CLOSE()" will not save changes unless you include the TRUE argument.

NOTE: This behavior is different from Microsoft Excel version 4.0. In Microsoft Excel 4.0, if you omit the argument, you are prompted to specify whether or not you want to save the changes.

WORKAROUND

If you want to be prompted to save changes when you close a file from a macro, use either of the following lines of code

  • Workbooks("<filename>").Close

    where <filename> is the name of the file that you want to close

    -or-

  • Application.ExecuteExcel4Macro "Close(True)"

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

For more information about ExecuteExcel4Macro,choose the Search button in Help and type:

   ExecuteExcel4Macro


KBCategory: kbprg kbcode
KBSubcategory:

Additional reference words: 5.00 5.00c 7.00
Keywords : kbcode kbprg
Version : 5.00 5.00c 7.00
Platform : 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: March 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.