+ Reply to Thread
Results 1 to 4 of 4

How to delete file

  1. #1
    Registered User
    Join Date
    08-09-2005
    Posts
    17

    How to delete file

    Hello,

    How do I delete a file with a macro?
    de


    thx

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning Kizzie

    Use this:

    Kill "C:\Thisfile.xls"

    Please note that this will not send the file to the recycle bin (this can't be done without resorting to Windows API calls) but will completely delete it.

    HTH

    DominicB

  3. #3
    Registered User
    Join Date
    08-09-2005
    Posts
    17
    thanks al lot

  4. #4
    Amedee Van Gasse
    Guest

    Re: How to delete file

    In <[email protected]>, kizzie told
    us an interesting story. My reply to this story is at the bottom of
    this message.

    >
    > Hello,
    >
    > How do I delete a file with a macro?
    > de
    >
    >
    > thx


    According to the MSDN Library, there are 2 ways to delete a file:


    FSO.DeleteFile(TestFilePath & "\Beatles\OctopusGarden.txt")

    Set File = FSO.GetFile(TestFilePath & "\Beatles\BathroomWindow.txt")
    File.Delete


    FSO, as you might have guessed, has to be declared as a
    FileSystemObject. GIYF for the gritty details.

    --
    Amedee Van Gasse

+ 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