Microsoft KB Archive/90037

{|
 * width="100%"|

Excel: Documentation Error on CLOSE Function

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, version 4.0
 * Microsoft Excel for the Macintosh, version 4.0

-

SUMMARY
In the &quot;Microsoft Excel Function Reference,&quot; version 4.0, the CLOSE functions documentation is incorrect. On page 56 of the Function Reference, the first and third remarks are incorrect.

MORE INFORMATION
The CLOSE command only closes one window of a document. If other windows of that document are open, the file itself is not closed.

The first remark on page 56 of the Microsoft Excel 4.0 Function Reference reads:

  If you close a workbook that contains an unbound sheet, Microsoft Excel saves the changes if SAVE_LOGICAL is TRUE, but does not close the window.

This is incorrect. If CLOSE is executed while the workbook contents page is active, there are two possibilities:


 * If none of the documents contained in the workbook are open in separate Windows, the workbook closes. If SAVE_LOGICAL is TRUE, the workbook is saved before it is closed.

-or-
 * If one or more documents contained in the workbook are open in separate Windows, only the window containing the workbook contents closes. No changes are saved on disk, regardless of the value of SAVE_LOGICAL.

In both cases, only the workbook contents window is closed. Any other windows that are open when CLOSE is executed remain open.

The third remark on page 56 of the &quot;Microsoft Excel Function Reference&quot; reads:

  If you make any changes to the contents of a workbook...then that information will be saved regardless of the SAVE_LOGICAL value.

This is only partially true. If none of the documents contained in the workbook are open in separate windows, the changes saved only if the SAVE_LOGICAL parameter is TRUE. However, if only a workbook window is closed, the information is saved in memory as long as the workbook remains open, but the file is not saved to disk.

To avoid confusion, it may be easier to use the SAVE.WORKBOOK command and/or the FILE.CLOSE command. Use FILE.CLOSE instead of CLOSE when you want to close an entire document instead of just one window in a document.