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?

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

    Function to determine Directory Size

    Bob Chmara, Sep 27, 2004, in forum: Microsoft Excel Discussion
    Replies:
    2
    Views:
    600
    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:
    639
    davegb
    Feb 6, 2005
  3. Robert

    How to determine desktop directory ?

    Robert, Mar 8, 2005, in forum: Microsoft Excel Discussion
    Replies:
    2
    Views:
    367
    Robert
    Mar 8, 2005
  4. IE Temp Names and Excel

    , Mar 21, 2006, in forum: Microsoft Excel Discussion
    Replies:
    2
    Views:
    192
  5. Sandy

    Original Excel File gets deleted and temp file gets created.

    Sandy, Dec 1, 2006, in forum: Microsoft Excel Discussion
    Replies:
    0
    Views:
    619
    Sandy
    Dec 1, 2006
  6. Replies:
    5
    Views:
    2,184
    Bruce Sinclair
    May 31, 2007
  7. 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:
    949
    Paul MacFarlane
    Mar 20, 2008
  8. Rick Stambach

    How does excel determine the range of a list?

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