ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How does Excel determine the TEMP directory? (https://www.excelbanter.com/excel-programming/272924-how-does-excel-determine-temp-directory.html)

Miso

How does Excel determine the TEMP directory?
 
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




Chip Pearson

How does Excel determine the TEMP directory?
 
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






Miso

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








Chris Jensen [MSFT]

How does Excel determine the TEMP directory?
 
Hello Miso,

Yes, Excel uses GetTempPath.
--------------------
From: "Miso"
References:


Subject: 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

"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









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/se...s/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.”



All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com