Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
%SYSTEMROOT%/Temp variable
Is anybody familiar with using this syntax as a variable for a path? I have a project with a hard-coded path to C:/WINNT/TEMP
Unfortunately this is causing problems with the new laptops with Office 2003 loaded OEM. They don't have that directory and I've been asked to try this variable shown in my subject line: %SYSTEMROOT%/Temp I could use some advice here. -- RMC,CPA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
%SYSTEMROOT%/Temp variable
That is the format for working with BAT files. For excel/vba, you can use
the environ function Sub tester1() For i = 1 To 20 Debug.Print Environ(i) Next End Sub produces: TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS PATH=C:\Program Files\Microsoft Office\Office;C:\WINDOWS;C:\WINDOWS\COMMAND COMSPEC=C:\WINDOWS\COMMAND.COM windir=C:\WINDOWS BLASTER=A220 I5 D1 so if you wanted a specific variable you can do vVar = Environ("Temp") or vVar=Environ("comspec") as examples: ? environ("Temp") C:\WINDOWS\TEMP ? environ("Comspec") C:\WINDOWS\COMMAND.COM ? environ("Windir") C:\WINDOWS -- Regards, Tom Ogilvy "R. Choate" wrote in message ... Is anybody familiar with using this syntax as a variable for a path? I have a project with a hard-coded path to C:/WINNT/TEMP Unfortunately this is causing problems with the new laptops with Office 2003 loaded OEM. They don't have that directory and I've been asked to try this variable shown in my subject line: %SYSTEMROOT%/Temp I could use some advice here. -- RMC,CPA |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
%SYSTEMROOT%/Temp variable
Thanks once again. You are the man, that's for sure.
-- RMC,CPA "Tom Ogilvy" wrote in message ... That is the format for working with BAT files. For excel/vba, you can use the environ function Sub tester1() For i = 1 To 20 Debug.Print Environ(i) Next End Sub produces: TMP=C:\WINDOWS\TEMP TEMP=C:\WINDOWS\TEMP PROMPT=$p$g winbootdir=C:\WINDOWS PATH=C:\Program Files\Microsoft Office\Office;C:\WINDOWS;C:\WINDOWS\COMMAND COMSPEC=C:\WINDOWS\COMMAND.COM windir=C:\WINDOWS BLASTER=A220 I5 D1 so if you wanted a specific variable you can do vVar = Environ("Temp") or vVar=Environ("comspec") as examples: ? environ("Temp") C:\WINDOWS\TEMP ? environ("Comspec") C:\WINDOWS\COMMAND.COM ? environ("Windir") C:\WINDOWS -- Regards, Tom Ogilvy "R. Choate" wrote in message ... Is anybody familiar with using this syntax as a variable for a path? I have a project with a hard-coded path to C:/WINNT/TEMP Unfortunately this is causing problems with the new laptops with Office 2003 loaded OEM. They don't have that directory and I've been asked to try this variable shown in my subject line: %SYSTEMROOT%/Temp I could use some advice here. -- RMC,CPA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp | Excel Discussion (Misc queries) | |||
Temp files on LAN file | Excel Discussion (Misc queries) | |||
Temp files in Excel | Excel Discussion (Misc queries) | |||
Temp File | Excel Programming | |||
Changing cells temp. | Excel Programming |