How can I display the operating system environment variable from Excel?
I have an application written in Excel plus a bunch of C ++ / Python additions.
The location of the various configuration files used by add-ons is determined at startup time by several environment variables. I would like to debug the problem with these environment variables in the most direct way possible: can I just enter an Excel formula that will display the environment variable in the worksheet?
Let me give you an example:
I have an environment variable called MYADDIN_XML_CONFIG that contains the path to the XML file used by the MyAddin component. If this environment variable is not set correctly, MyAddin will not work. I would like to have one simple function that takes the string " MYADDIN_XML_CONFIG " in as an argument and returns env-var if set.If no environment variable is set, it should return NONE or some error code.
Can this be done?
FYI, MS Excel 2003 on Windows XP.
source to share