+ Reply to Thread
Results 1 to 5 of 5

macro to delete a read-only file from a folder

  1. #1
    Registered User
    Join Date
    06-22-2005
    Location
    Washington, USA
    MS-Off Ver
    Office 365
    Posts
    40

    macro to delete a read-only file from a folder

    I tried the Kill method, but it doesn't work with a read-only file. Unless I'm doing it wrong.

    kill *filepath*

    anyone have a suggestion? I was thinking maybe I could change the read-only status, but couldn't figure out how to do that either.

    thanks in advance for your help. If there's already a thread, please post the link for me. I tried different searches but couldn't come up with anything.

    -joel

  2. #2
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Hi jojotherider,

    I did a google search for "vba to delete a read only file" and got this site

    http://word.mvps.org/faqs/macrosvba/DeleteFiles.htm

    and in there is the following code which I think is what you are looking for

    Please Login or Register  to view this content.
    Hope this helps

    Seamus

  3. #3
    Registered User
    Join Date
    06-22-2005
    Location
    Washington, USA
    MS-Off Ver
    Office 365
    Posts
    40
    awesome, I actually just figured out that same coding right before I got notification you replied. I was going to take the simple solution:

    Please Login or Register  to view this content.
    I kind of like your version though.

  4. #4
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    You're welcome

  5. #5
    Registered User
    Join Date
    06-22-2005
    Location
    Washington, USA
    MS-Off Ver
    Office 365
    Posts
    40
    heh, forgot to say thanks.

    so...Thanks!

    -joel

+ 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