Excel: Using the REQUEST Macro Command for System InformationLast reviewed: July 25, 1995Article ID: Q33065 |
The information in this article applies to:
SUMMARYThe following article explains how to use the REQUEST command from a Microsoft Excel macro with the topic of "system." The REQUEST command is supported only with a full version of Microsoft Windows operating system, version 2.03 or later and the OS/2 Presentation Manager (PM). The sample macro below executes another copy of Microsoft Excel, initiates a DDE (dynamic data exchange) channel to that copy of Microsoft Excel with the topic of "system," and uses the REQUEST command for system information. To understand this article, you should be familiar with the following information (page numbers refer to the "Microsoft Excel Function Reference," version 3.0).
MORE INFORMATIONThis example assumes that a second copy of Microsoft Excel is being used as the used as the second application for the DDE link. The macro is as follows (starting in cell A2 of the macro sheet):
A2: =EXEC("excel") A3: =INITIATE("excel"&A2,"system") A4: =INDEX(REQUEST(A3,"SysItems"),3) A5: =TERMINATE(A3) A6: =RETURN()After this macro is executed, the value "Status" is placed in cell A4 of the macro sheet. Please note that the system topic "SysItems" returns a list of available items in the "System" topic. Any item returned by "SysItems" can be used as a "system" item and thus could be used in the REQUEST function. For Microsoft Excel, the list of available topics includes the following:
=INDEX(REQUEST(A3,"Formats"),1)In this case, the value of "Biff" is returned. The INDEX function must be used because topics return a list of values. If the INDEX function is not used, only the first value of that returned list will be visible. If an INDEX request is made beyond the range of returned values, a #REF error is returned.
REFERENCES"Microsoft Excel User's Guide 2," version 4.0, page 302 "Microsoft Excel User's Guide," version 3.0, page 343 "Microsoft Excel Reference," version 2.x, 265
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |