How does Excel determine the TEMP directory?

Discussion in 'Microsoft Excel Discussion' started by Miso, Jul 29, 2003.

  1. Miso

    Miso Guest

    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, Jul 29, 2003
    #1
    1. Advertisements

  2. Miso

    Tushar Mehta Guest

    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$>,
    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
    >
    >
    >
    >
     
    Tushar Mehta, Jul 29, 2003
    #2
    1. Advertisements

  3. 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" <> escreveu na mensagem
    news:e$...
    > 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
    >
    >
    >
     
    Orlando Magalhães Filho, Aug 1, 2003
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Chmara

    Function to determine Directory Size

    Bob Chmara, Sep 27, 2004, in forum: Microsoft Excel Discussion
    Replies:
    2
    Views:
    476
    Dana DeLouis
    Sep 27, 2004
  2. davegb

    macro to move from directory to directory

    davegb, Jan 23, 2005, in forum: Microsoft Excel Discussion
    Replies:
    20
    Views:
    450
    davegb
    Feb 6, 2005
  3. Robert

    How to determine desktop directory ?

    Robert, Mar 8, 2005, in forum: Microsoft Excel Discussion
    Replies:
    2
    Views:
    238
    Robert
    Mar 8, 2005
  4. Paul MacFarlane

    How does Excel determine if a file is already in use?

    Paul MacFarlane, Mar 19, 2008, in forum: Microsoft Excel Discussion
    Replies:
    6
    Views:
    631
    Paul MacFarlane
    Mar 20, 2008
  5. Rick Stambach

    How does excel determine the range of a list?

    Rick Stambach, Oct 2, 2008, in forum: Microsoft Excel Discussion
    Replies:
    4
    Views:
    191
    ShaneDevenshire
    Oct 2, 2008
Loading...

Share This Page