XL5: GET.DOCUMENT(4) Returns FALSE After FOR.CELL Function

Last reviewed: September 12, 1996
Article ID: Q118654
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

In Microsoft Excel, if you use the FOR.CELL() macro function, and you then use the GET.DOCUMENT(4) function without the name_text argument, or with a workbook name, to return a value indicating whether changes have been made to the workbook since you saved it last, the value returned by this function is FALSE.

CAUSE

If the name_text argument of the GET.DOCUMENT function is omitted, it is assumed to be the active document. However, when you use the GET.DOCUMENT(4) function without the name_text argument, or with the workbook name, following the FOR.CELL function, FALSE is returned even when you have made changes to the workbook.

This behavior occurs only if the macro that contains the FOR.CELL() function does not make changes to the workbook. For example, if you save changes to your workbook, and then run the macro that contains the FOR.CELL function, the GET.DOCUMENT(4) function should return the value FALSE, because you have not made changes to the workbook since you saved it last. However, if you then make changes to a worksheet in the workbook, and run the FOR.CELL function again, the GET.DOCMENT(4) function returns FALSE, even though you have made changes to the workbook.

This behavior occurs because when you use the FOR.CELL() function, in the process of naming the cell that the function is currently using, the macro sheet is marked as having changes and is then marked as not having changes. However, when the macro sheet is marked as not having any changes (when the function has ended), the workbook is also incorrectly marked as not having any changes.

Note that if you make a change to the macro sheet that contains the FOR.CELL() function, the GET.DOCUMENT(4) function returns the value TRUE.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel for Windows version 5.0c.

REFERENCES

For more information about GET.DOCUMENT, choose the Search button in Microsoft Excel Macro Functions Help and type:

   GET.DOCUMENT function


KBCategory: kbprb
KBSubcategory:

Additional reference words: 5.00 dirty clean



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: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.