View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Miso Miso is offline
external usenet poster
 
Posts: 2
Default How does Excel determine the TEMP directory?

I did it, as I wrote in my question.
And again :
Do the Excel the same?

Miso

"Chip Pearson" wrote in message
...
Miso,

You can use GetTempPath to get the temporary directory name:


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

Sub AAA()
Dim TempPath As String
Dim L As Long: L = 255
Dim Res As Long
TempPath = String$(L, " ")
Res = GetTempPath(L, TempPath)
TempPath = Left(TempPath, Res)
Debug.Print TempPath
End Sub


"Miso" wrote in message
...
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