PC Review


Reply
Thread Tools Rate Thread

How does Excel determine the TEMP directory?

 
 
Miso
Guest
Posts: n/a
 
      29th Jul 2003
Hello,

I would like to put Excel file into such a directory
in which I will be sure that has security settings ReadWrite.

If I know, on the arbitrary computer,
that Excel is working OK,
it means that Excel's TEMP directory has
under logged user security settings = ReadWrite.

If I set "C:\Documents and Settings\******\Local Settings\Temp"
directory to ReadOnly,
the Excel will not work.

The C function GetTempPath returns
the above directory, may The Excel using this C function?

Do anybody know which way the Excel determine
where the TEMP directory is?

Thanks

Miso



 
Reply With Quote
 
 
 
 
Tushar Mehta
Guest
Posts: n/a
 
      29th Jul 2003
ENVIRON("TEMP") or ENVIRON("TMP") should give you that information.

Also, with a reference to the Windows Scripting Host, the
GetSpecialFolder method of the FileSystemObject object will give you
what you want.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <e$(E-Mail Removed)>, (E-Mail Removed)
says...
> Hello,
>
> I would like to put Excel file into such a directory
> in which I will be sure that has security settings ReadWrite.
>
> If I know, on the arbitrary computer,
> that Excel is working OK,
> it means that Excel's TEMP directory has
> under logged user security settings = ReadWrite.
>
> If I set "C:\Documents and Settings\******\Local Settings\Temp"
> directory to ReadOnly,
> the Excel will not work.
>
> The C function GetTempPath returns
> the above directory, may The Excel using this C function?
>
> Do anybody know which way the Excel determine
> where the TEMP directory is?
>
> Thanks
>
> Miso
>
>
>
>

 
Reply With Quote
 
 
 
 
Orlando Magalh„es Filho
Guest
Posts: n/a
 
      1st Aug 2003
Hi Miso,

For me, until now this API always return Excel temp folder:

Private Declare Function GetTempPath Lib "kernel32" _
Alias "GetTempPathA" (ByVal nBufferLength As Long, _
ByVal lpBuffer As String) As Long

Function TempFolder() As String
'Get Temp Folder
Dim fctRet As Long
TempFolder = String$(255, 0)
fctRet = GetTempPath(255, TempFolder)
If fctRet <> 0 Then
TempFolder = Left(TempFolder, fctRet)
If Right(TempFolder, 1) = "\" Then TempFolder = Left(TempFolder,
Len(TempFolder) - 1)
Else
TempFolder = ""
End If
End Function


"Miso" <(E-Mail Removed)> escreveu na mensagem
news:e$(E-Mail Removed)...
> Hello,
>
> I would like to put Excel file into such a directory
> in which I will be sure that has security settings ReadWrite.
>
> If I know, on the arbitrary computer,
> that Excel is working OK,
> it means that Excel's TEMP directory has
> under logged user security settings = ReadWrite.
>
> If I set "C:\Documents and Settings\******\Local Settings\Temp"
> directory to ReadOnly,
> the Excel will not work.
>
> The C function GetTempPath returns
> the above directory, may The Excel using this C function?
>
> Do anybody know which way the Excel determine
> where the TEMP directory is?
>
> Thanks
>
> Miso
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
%temp% points to %systemroot%\temp instead of %userprofile%\LocalS~1\temp Gordon Fecyk Windows XP Setup 6 28th Mar 2005 09:53 PM
%temp% points to %systemroot%\temp instead of %userprofile%\LocalS~1\temp Gordon Fecyk Windows XP Security 6 28th Mar 2005 09:53 PM
16-bit %temp% points to %systemroot%\temp Gordon Fecyk Windows XP Security 0 24th Feb 2005 06:59 PM
Cookies,Temp Internet Files & History Recreating In C:\Windows\Temp The Bandit Windows XP Help 2 20th Apr 2004 01:52 PM
How does Excel determine the TEMP directory? Miso Microsoft Excel Programming 3 31st Jul 2003 02:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:35 PM.