How does Excel determine the TEMP directory?

M

Miso

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
 
C

Chip Pearson

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
 
C

Chris Jensen [MSFT]

Hello Miso,

Yes, Excel uses GetTempPath.
--------------------
Subject: Re: How does Excel determine the TEMP directory?
Date: Tue, 29 Jul 2003 14:44:22 +0200

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

Miso

Regards,
Chris Jensen[MSFT]

This posting is provided “AS IS” with no warranties, and confers no rights.

“Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?  If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026.”
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top