Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default %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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default %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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default %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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
Temp files on LAN file Lp12 Excel Discussion (Misc queries) 0 July 18th 06 07:45 AM
Temp files in Excel Roselyn Nicewarner Excel Discussion (Misc queries) 1 August 10th 05 11:49 PM
Temp File Jullie Excel Programming 0 December 15th 03 05:33 PM
Changing cells temp. fwday[_3_] Excel Programming 8 October 30th 03 01:42 PM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"