XL5: DOCUMENTS() and WINDOWS() Return XL5GALRY.XLS Filename |
In Microsoft Excel, if you use the DOCUMENTS() or the WINDOWS() macro function to return a list of open documents or document windows, the filename XL5GALRY.XLS is returned in this list.
This behavior occurs if you have used the Options dialog box in the current
session of Microsoft Excel. When you choose Options from the Tools menu,
the file XL5GALRY.XLS is opened as a hidden file to access information
about your default chart format. This file is not listed on the Window
menu, and you cannot unhide this file. However, when you use the DOCUMENTS
or the WINDOWS macro functions, the filename is returned as one of the
currently open files or windows. The XL5GALRY.XLS file is located in your
XLSTART directory.
This behavior may cause a macro error, or unexpected macro results if
your macro uses all of the returned filenames to manipulate each of
the open files or windows.
' Dimension wb as object type
Dim wb as Object
For each wb in Workbooks
' loop through each open Workbook and
' display the name in a message box
MsgBox wb.Name
Next
' Dimension w as object type
Dim w as Object
' loop through each window on the Window menu and
' display the name in a message box
For each w in Windows
MsgBox w.caption
Next
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.
You can use the DOCUMENTS() function on a macro sheet to return the names of open workbooks to use in other functions that manipulate open workbooks. Similarly, you can use the WINDOWS() macro function to return a list of active windows to use with other macro functions to manipulate windows. The names returned by both of these functions are returned as a horizontal array of text values.
For more information about WINDOWS, choose the Search button in the Microsoft Excel Macro Functions Help and type:
WINDOWS functionFor more information about DOCUMENTS, choose the Search button in the Microsoft Excel Macro Functions Help and type:
DOCUMENTS function
Additional query words:
Keywords :
Version : 5.00
Platform : WINDOWS
Issue type :
Technology :
|
Last Reviewed: September 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |