+ Reply to Thread
Results 1 to 2 of 2

SaveCopyAs - holding onto file handle

  1. #1
    Registered User
    Join Date
    10-27-2006
    Posts
    4

    SaveCopyAs - holding onto file handle

    Hi,

    I'm having a problem with a piece of code that I have written. See below.
    The code creates files in paritcular folders, but each time it is run the computer seems to hold onto the last file that was created. This means that when I try to delete the files(as I am testing the code), the computer refuses to delete the last file that was created. I figured that I need to close the file in the code, but this doesn't seem to work as I am doing a savecopyas from a template file. The reason I am doing this is that I want to keep the template file open with its original name ready for another loop through the code. Does anyone know how I can sort this problem out?



    Please Login or Register  to view this content.
    Many thanks,
    C
    Last edited by mudraker; 06-06-2007 at 07:20 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try having a final line

    Please Login or Register  to view this content.
    to close any file.

    It may also be worth having the same line at the start of your code to clear up any opened files.
    Martin

+ 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