+ Reply to Thread
Results 1 to 8 of 8

Excel temporary files

  1. #1
    Simon
    Guest

    Excel temporary files

    Hi

    Why excel create a temporary named like "A4506B00" ?
    Is possible configure excel to delete these file on exit ?

    Thanks Simon.




  2. #2
    Bob Phillips
    Guest

    Re: Excel temporary files

    They should, but temp files get left. I use a VBScript to delete them when I
    log in by putting the following code in a .vbs text file, and schedule that
    file to run on startup

    '---------------------------------------------------------------------------
    ----
    ' File: tempDirTidy
    ' Function: deletes inactive files from the Windows Temp directory
    ' i.e. files not automatically deleted by the creating process
    '---------------------------------------------------------------------------
    ----

    Const TemporaryFolder = 2 'for GetSpecialFolder

    Set FSO = CreateObject("Scripting.FileSystemObject")

    'init an empty array (UBound will be -1)...
    '
    'we use an array and store the file objects as this avoids any problems
    ' with altering the contents of the Files collections while they
    ' are being iterated.

    arFiles = Array()
    count = -1

    'get the path to the temp folder
    '
    tempdir = FSO.GetSpecialFolder(TemporaryFolder)

    'load the (global scope) array arFiles
    'SelectFiles calls itself recursively for SubFolders

    SelectFiles tempdir

    'the error trap is in case any are in-use...

    dCount = 0
    For Each file In Arfiles
    On Error Resume Next
    file.Delete True
    If Err.Number = 0 Then
    dCount = dCount + 1
    End If
    Err.Clear
    On Error Goto 0
    Next

    'now go back and delete empty folders below the temp folder

    DeleteEmptyFolders tempdir,False

    'comment out for "silent" operation,
    ' or add support for a "/s" command-line switch.

    Msgbox count+1 & " files were found in " & tempdir & vbcrlf & dCount & " of
    those files were deleted.", vbInformation,"Windows Temp Directory Tidy-up"


    '---------------------------------------------------------------------------
    ----
    Sub SelectFiles(sPath)
    '---------------------------------------------------------------------------
    ----

    'select files to delete and add to array...

    Set Folder = FSO.Getfolder(sPath)
    Set Files = Folder.Files

    For Each file In Files
    Count = Count + 1
    Redim Preserve arFiles(Count)
    Set arFiles(Count) = file
    Next

    For Each fldr In Folder.Subfolders
    Selectfiles Fldr.Path
    Next

    End Sub


    '---------------------------------------------------------------------------
    ----
    Sub DeleteEmptyFolders(sPath,fDeleteThisFolder)
    '---------------------------------------------------------------------------
    ----

    Set Folder = FSO.GetFolder(sPath)

    'recurse first...

    For Each fldr In Folder.Subfolders
    DeleteEmptyFolders fldr.Path,True
    Next

    'if no files or folders then delete...

    'fDeleteThisFolder is False for the root of the subtree,
    ' and true for sub-folders (unless you want to delete
    ' the entire subtree if it is empty).

    If (Folder.Files.Count = 0) And _
    (Folder.Subfolders.Count) = 0 And _
    fDeleteThisFolder Then
    Folder.Delete
    Exit Sub
    End If

    End Sub

    '---------------------------------
    end-script ---------------------------------


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Simon" <nospam> wrote in message
    news:uoGs59NHGHA.1088@tk2msftngp13.phx.gbl...
    > Hi
    >
    > Why excel create a temporary named like "A4506B00" ?
    > Is possible configure excel to delete these file on exit ?
    >
    > Thanks Simon.
    >
    >
    >




  3. #3
    Dave Peterson
    Guest

    Re: Excel temporary files

    I think Bob responded with a suggestion on how to clean up temporary files in
    the windows temp folder.

    But I'm guessing that's not the problem.

    When excel saves the file, it saves it as a temporary file with a funny name (8
    characters--no extension).

    If the save is successful, xl will delete the original (or rename it to its
    backup name (like "backup of book1.xlk)) and if that's successful, xl will
    rename the funny named file to the original's name.

    Common things that get blamed for interruptions to this process are antivirus
    software poking its head in or network errors--either permissions or physical
    problems.

    Maybe temporarily disabling the antivirus software would be the easier thing to
    test.



    Simon wrote:
    >
    > Hi
    >
    > Why excel create a temporary named like "A4506B00" ?
    > Is possible configure excel to delete these file on exit ?
    >
    > Thanks Simon.


    --

    Dave Peterson

  4. #4
    Bob Phillips
    Guest

    Re: Excel temporary files

    When Excel crashes as often as mine does, you will always get left with
    temporary files, even if there is nothing interfering <vbg>

    Bob

    "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    news:43CF87C4.916B93EA@verizonXSPAM.net...
    > I think Bob responded with a suggestion on how to clean up temporary files

    in
    > the windows temp folder.
    >
    > But I'm guessing that's not the problem.
    >
    > When excel saves the file, it saves it as a temporary file with a funny

    name (8
    > characters--no extension).
    >
    > If the save is successful, xl will delete the original (or rename it to

    its
    > backup name (like "backup of book1.xlk)) and if that's successful, xl will
    > rename the funny named file to the original's name.
    >
    > Common things that get blamed for interruptions to this process are

    antivirus
    > software poking its head in or network errors--either permissions or

    physical
    > problems.
    >
    > Maybe temporarily disabling the antivirus software would be the easier

    thing to
    > test.
    >
    >
    >
    > Simon wrote:
    > >
    > > Hi
    > >
    > > Why excel create a temporary named like "A4506B00" ?
    > > Is possible configure excel to delete these file on exit ?
    > >
    > > Thanks Simon.

    >
    > --
    >
    > Dave Peterson




  5. #5
    Simon
    Guest

    Re: Excel temporary files

    HI Dave

    Yes I have an antivirus, now try to disable it.
    I'm forgot to explain that I open a the xl file from a network path.

    Thanks


    "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    news:43CF87C4.916B93EA@verizonXSPAM.net...
    >I think Bob responded with a suggestion on how to clean up temporary files
    >in
    > the windows temp folder.
    >
    > But I'm guessing that's not the problem.
    >
    > When excel saves the file, it saves it as a temporary file with a funny
    > name (8
    > characters--no extension).
    >
    > If the save is successful, xl will delete the original (or rename it to
    > its
    > backup name (like "backup of book1.xlk)) and if that's successful, xl will
    > rename the funny named file to the original's name.
    >
    > Common things that get blamed for interruptions to this process are
    > antivirus
    > software poking its head in or network errors--either permissions or
    > physical
    > problems.
    >
    > Maybe temporarily disabling the antivirus software would be the easier
    > thing to
    > test.
    >
    >
    >
    > Simon wrote:
    >>
    >> Hi
    >>
    >> Why excel create a temporary named like "A4506B00" ?
    >> Is possible configure excel to delete these file on exit ?
    >>
    >> Thanks Simon.

    >
    > --
    >
    > Dave Peterson




  6. #6
    Dave Peterson
    Guest

    Re: Excel temporary files

    If you have trouble disabling the antivirus, you may want to post what you're
    using. Maybe someone can help.

    Simon wrote:
    >
    > HI Dave
    >
    > Yes I have an antivirus, now try to disable it.
    > I'm forgot to explain that I open a the xl file from a network path.
    >
    > Thanks
    >
    > "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    > news:43CF87C4.916B93EA@verizonXSPAM.net...
    > >I think Bob responded with a suggestion on how to clean up temporary files
    > >in
    > > the windows temp folder.
    > >
    > > But I'm guessing that's not the problem.
    > >
    > > When excel saves the file, it saves it as a temporary file with a funny
    > > name (8
    > > characters--no extension).
    > >
    > > If the save is successful, xl will delete the original (or rename it to
    > > its
    > > backup name (like "backup of book1.xlk)) and if that's successful, xl will
    > > rename the funny named file to the original's name.
    > >
    > > Common things that get blamed for interruptions to this process are
    > > antivirus
    > > software poking its head in or network errors--either permissions or
    > > physical
    > > problems.
    > >
    > > Maybe temporarily disabling the antivirus software would be the easier
    > > thing to
    > > test.
    > >
    > >
    > >
    > > Simon wrote:
    > >>
    > >> Hi
    > >>
    > >> Why excel create a temporary named like "A4506B00" ?
    > >> Is possible configure excel to delete these file on exit ?
    > >>
    > >> Thanks Simon.

    > >
    > > --
    > >
    > > Dave Peterson


    --

    Dave Peterson

  7. #7
    Simon
    Guest

    Re: Excel temporary files

    Hi I think to have found the problem, the user that use xl, have create
    right but don't have delete right on network folder.

    Thanks for help.

    Simon.


    "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    news:43CFA0A3.B844FB17@verizonXSPAM.net...
    > If you have trouble disabling the antivirus, you may want to post what
    > you're
    > using. Maybe someone can help.
    >
    > Simon wrote:
    >>
    >> HI Dave
    >>
    >> Yes I have an antivirus, now try to disable it.
    >> I'm forgot to explain that I open a the xl file from a network path.
    >>
    >> Thanks
    >>
    >> "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    >> news:43CF87C4.916B93EA@verizonXSPAM.net...
    >> >I think Bob responded with a suggestion on how to clean up temporary
    >> >files
    >> >in
    >> > the windows temp folder.
    >> >
    >> > But I'm guessing that's not the problem.
    >> >
    >> > When excel saves the file, it saves it as a temporary file with a funny
    >> > name (8
    >> > characters--no extension).
    >> >
    >> > If the save is successful, xl will delete the original (or rename it to
    >> > its
    >> > backup name (like "backup of book1.xlk)) and if that's successful, xl
    >> > will
    >> > rename the funny named file to the original's name.
    >> >
    >> > Common things that get blamed for interruptions to this process are
    >> > antivirus
    >> > software poking its head in or network errors--either permissions or
    >> > physical
    >> > problems.
    >> >
    >> > Maybe temporarily disabling the antivirus software would be the easier
    >> > thing to
    >> > test.
    >> >
    >> >
    >> >
    >> > Simon wrote:
    >> >>
    >> >> Hi
    >> >>
    >> >> Why excel create a temporary named like "A4506B00" ?
    >> >> Is possible configure excel to delete these file on exit ?
    >> >>
    >> >> Thanks Simon.
    >> >
    >> > --
    >> >
    >> > Dave Peterson

    >
    > --
    >
    > Dave Peterson




  8. #8
    Dave Peterson
    Guest

    Re: Excel temporary files

    Glad you got it working.

    Simon wrote:
    >
    > Hi I think to have found the problem, the user that use xl, have create
    > right but don't have delete right on network folder.
    >
    > Thanks for help.
    >
    > Simon.
    >
    > "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    > news:43CFA0A3.B844FB17@verizonXSPAM.net...
    > > If you have trouble disabling the antivirus, you may want to post what
    > > you're
    > > using. Maybe someone can help.
    > >
    > > Simon wrote:
    > >>
    > >> HI Dave
    > >>
    > >> Yes I have an antivirus, now try to disable it.
    > >> I'm forgot to explain that I open a the xl file from a network path.
    > >>
    > >> Thanks
    > >>
    > >> "Dave Peterson" <petersod@verizonXSPAM.net> wrote in message
    > >> news:43CF87C4.916B93EA@verizonXSPAM.net...
    > >> >I think Bob responded with a suggestion on how to clean up temporary
    > >> >files
    > >> >in
    > >> > the windows temp folder.
    > >> >
    > >> > But I'm guessing that's not the problem.
    > >> >
    > >> > When excel saves the file, it saves it as a temporary file with a funny
    > >> > name (8
    > >> > characters--no extension).
    > >> >
    > >> > If the save is successful, xl will delete the original (or rename it to
    > >> > its
    > >> > backup name (like "backup of book1.xlk)) and if that's successful, xl
    > >> > will
    > >> > rename the funny named file to the original's name.
    > >> >
    > >> > Common things that get blamed for interruptions to this process are
    > >> > antivirus
    > >> > software poking its head in or network errors--either permissions or
    > >> > physical
    > >> > problems.
    > >> >
    > >> > Maybe temporarily disabling the antivirus software would be the easier
    > >> > thing to
    > >> > test.
    > >> >
    > >> >
    > >> >
    > >> > Simon wrote:
    > >> >>
    > >> >> Hi
    > >> >>
    > >> >> Why excel create a temporary named like "A4506B00" ?
    > >> >> Is possible configure excel to delete these file on exit ?
    > >> >>
    > >> >> Thanks Simon.
    > >> >
    > >> > --
    > >> >
    > >> > Dave Peterson

    > >
    > > --
    > >
    > > Dave Peterson


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1