The information in this article applies to:
IMPORTANT: The CALL() and REGISTER() functions are provided for advanced users only. If you use these functions incorrectly you could accidentally cause errors in your system's operation. SUMMARYIt is possible to retrieve the value of the first environment variable from the DOS environment string from within Microsoft Excel if you are running under Microsoft Windows. This is done using the CALL and REGISTER functions. One possible use for this would be to determine the directory from which Microsoft Windows was started. MORE INFORMATION
The DOS environment is an area of memory that DOS sets aside to store
a series of ASCII strings. Each string in the environment is
terminated by a byte of zero. The final string is terminated by two
bytes of zero.
Note: The CALL function can also be used on a standard worksheet in Microsoft Excel versions 3.0 and later. Adding Variable to Beginning of Environment StringTo arrange for a particular string to be placed at the beginning of the environment string, you must redefine all environment variables in a particular order. When an environment variable is first defined, its string is appended to the end of the existing environment string. If the variable was previously defined, it is deleted from its old position in the string and appended to the end.To retrieve an environment string called "CURDIR" that you set to the current directory before running Microsoft Windows, using the macro example above, do the following:
REFERENCES
"Microsoft Excel Function Reference," version 4.0, pages 42-43,
350-352, 475-480
Additional query words: 2.1 2.10 3.0 3.00 4.0 4.00 5.00
Keywords : |
Last Reviewed: March 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |