+ Reply to Thread
Results 1 to 7 of 7

Excel Temp files

  1. #1
    Registered User
    Join Date
    01-06-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Excel Temp files

    Have an excel 2010 file with code behind creating another excel file from options selected. Been uses this file long time and just making copies and making modifications for new month. In process of creating a new monthly file some current sheets are deleted and some other sheets are copied from another excel file and the code behind is executed. All if sudden started getting error message can not find a temp file. I finally got the file the way it should be by deleting a lot of temp files in local\temp directory. Passed the new file to a user for testing, first time processing it worked fine. But on second time got error message File not found: 'c:\Temp\VBEF4E.tmp, click ok the 400 error message. When user close the excel file and opened back up same thing: first account worked, error message on second account.

    How to fix this problem? Don't want to go to each users to delete temp files, it might happen again.

    Any help would be appreciated

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,649

    Re: Excel Temp files

    Excel usually manages its own temporary files. The implication is that Excel is not closing them/itself down tidily and they are left behind. Or, maybe, the code is looking in the wrong folder for the temporary file created by your process/code.

    Given that you haven't shared the workbook or code, it's difficult to offer anything more specific.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-27-2017
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    6

    Re: Excel Temp files

    Good afternoon,

    If I understood well, your code creates a temporary file which is later used by an user, the first time the codes relates to the temp file, it works fine, but the next times it won't.

    If so, what I do for those kind of codes is, creating a "Temporary files" folder on the PC or Server, and saving the new excel with the same name on that path. So for example, you would have "Temp_Excel_for_User_1.xls" on "Temporary files folder.
    Whenever you need to change that temporary file, you can command it to overwrite if there's an Excel file with the same name on that folder. So you won't be creating tons of temporary files, but a normal excel file that is always overwrited when you need it, and therefore the path and the excel name always stay the same, so users won't need to erase anything.

    I hope this can help you out, BR

  4. #4
    Registered User
    Join Date
    01-06-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Excel Temp files

    After doing more some debugging on the code the error is actually happening of copy sheet command. It appears the code cannot find the specific worksheet to copy. Error happens randomly more testing that is been done.

    Please Login or Register  to view this content.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,649

    Re: Excel Temp files

    Can you upload a sample workbook with some typical data? If you can describe the process you follow, it may be possible to reproduce the problem.

    We, at least I, can't step through the code to check it without the workbook + data + process.

  6. #6
    Registered User
    Join Date
    01-06-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Excel Temp files

    After spending time, the problem for some unknown reason the command stopped working after years of working. Sheets("Item Master").Copy when try other methods I break macros/formulas. What is the best practice to create a new workbook from current open workbook sheet? The open workbook has 5 sheets, need to use just the 2 sheet to create the workbook. I am using Excel 2010, XLSM format

    Thanks for additional help.
    Last edited by godistop1; 12-01-2017 at 10:31 AM.

  7. #7
    Registered User
    Join Date
    01-06-2012
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Excel Temp files

    Never did figure out why all of the sudden the Sheet().Copy started erroring out. I changed the method of creating the new file without breaking any macros.
    Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel in Place in SAP creating temp files
    By scottiex in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2016, 12:36 AM
  2. Replies: 1
    Last Post: 01-12-2015, 08:07 PM
  3. Replies: 1
    Last Post: 09-26-2012, 09:37 AM
  4. Replies: 0
    Last Post: 03-15-2012, 04:13 PM
  5. Prevent Excel from creating temp files?
    By WhiteFalcon in forum Excel General
    Replies: 0
    Last Post: 04-12-2007, 02:11 AM
  6. Temp files in Excel
    By Roselyn Nicewarner in forum Excel General
    Replies: 1
    Last Post: 08-10-2005, 07:05 PM
  7. [SOLVED] Where are the temp excel files kept?
    By April in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2005, 09:06 PM

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