+ Reply to Thread
Results 1 to 5 of 5

Delete File in a folder

  1. #1
    Les Stout
    Guest

    Delete File in a folder

    Hi all, i save a file to a folder using a certain name and after i have
    finished with it and closed it i need to delete it. I have played with
    some code but just cannot get it to work. Could somebody help me out of
    my misary please !!

    Les Stout

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    Raymond Cruz
    Guest

    Re: Delete File in a folder

    Set fs = CreateObject("Scripting.FileSystemObject")
    Set obj = fs.GetFile("your-file-name")
    obj.Delete

    "Les Stout" <[email protected]> wrote in message
    news:%[email protected]...
    > Hi all, i save a file to a folder using a certain name and after i have
    > finished with it and closed it i need to delete it. I have played with
    > some code but just cannot get it to work. Could somebody help me out of
    > my misary please !!
    >
    > Les Stout
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




  3. #3
    Tom Ogilvy
    Guest

    Re: Delete File in a folder

    If you want to use the built in VBA capabilities:

    Kill "C:\MyFolder\MyFile.xls"


    --
    Regards,
    Tom Ogilvy

    "Les Stout" <[email protected]> wrote in message
    news:%[email protected]...
    > Hi all, i save a file to a folder using a certain name and after i have
    > finished with it and closed it i need to delete it. I have played with
    > some code but just cannot get it to work. Could somebody help me out of
    > my misary please !!
    >
    > Les Stout
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




  4. #4
    Bob Phillips
    Guest

    Re: Delete File in a folder


    Kill full_filename_including_path

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Les Stout" <[email protected]> wrote in message
    news:%[email protected]...
    > Hi all, i save a file to a folder using a certain name and after i have
    > finished with it and closed it i need to delete it. I have played with
    > some code but just cannot get it to work. Could somebody help me out of
    > my misary please !!
    >
    > Les Stout
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




  5. #5
    Les Stout
    Guest

    Re: Delete File in a folder

    Thanks Bob and Tom, have a great weekend.

    best regards,

    Les Stout

    *** Sent via Developersdex http://www.developersdex.com ***

+ 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