Excel: GET.WORKBOOK Returns ErrorID: Q86196
|
The GET.WORKBOOK function will return #N/A if the name of the workbook is not specified, and if the Workbook Contents Window is not the active document when the macro executes this function.
Page 209 of the "Microsoft Excel Function Reference" states that the
optional argument to GET.WORKBOOK, "NAME_TEXT," is the name of an open
workbook, and if omitted, is assumed to be the active workbook.
This documentation is incomplete. It does not state that the Workbook
Contents Window of the active workbook must be the active window for
GET.WORKBOOK to return the correct values. If any other window of the
workbook is active, and the second argument is omitted, GET.WORKBOOK
will return #N/A.
Use the Get.Document() function when trying to return the name of the
active document in a workbook. If you use the following syntax on a macro
sheet:
A1: =Get.Document(1)
A1: count=Search("]",Get.Document(1))
A2: =MID(GET.DOCUMENT(1),count+1,LEN(GET.DOCUMENT(1))-count)
"Microsoft Excel Function Reference," version 4.0, pages 4, 209, 460
"Microsoft Excel User's Guide 1," version 4.0, page 69
Additional query words:
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: March 25, 1999