Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to be able to use a Windows Environment variable (i.e. TEMP) from Macro. Want to specify where my exported file is located. Is this possible?
ActiveDocument.GetSheetObject( "Check01Chart01" ).Export "$(TEMP)\test01a.csv", ","
I believe there is a method called ExpandEnvironmentStrings. Sorry don't have any example code, but I'm sure it's easy to google-
Thanks, but googling on QlikView & ExpandEnvironmentStrings does not return any information on such a function.
Hi,
You can do same with less lines from script
EXECUTE cmd /C "set > var.txt" ;
LOAD
@1 as var_name,
@2 as var_value
FROM [var.txt] (txt, codepage is 1252, no labels, delimiter is '=', no quotes);
-Alex
Another script-based method which doesn't use temporary files is to query the environment variables directly from the registry:
LET env_var_value = GetRegistryString('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'env_var_name');
Simon