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

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

Additional query words: dirty clean

Keywords :
Version : 5.00
Platform : WINDOWS
Issue type :


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