+ Reply to Thread
Results 1 to 4 of 4

Kill a file anywhere in the pc If File is present

  1. #1
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Kill a file anywhere in the pc If File is present

    Hi,
    I need Help
    I am looking for a VBA code that will kill the file If it is present anywhere in the pc
    File name is ag.csv

    Thnx for the Help
    Last edited by Leonardo1234; 06-16-2023 at 10:33 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,776

    Re: Kill a file anywhere in the pc If File is present

    Why do you want to do this with VBA? The function you want to perform is not related to anything in Excel. I would just use Windows Explorer search or a third-party search tool (I use FileLocator Pro).
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: Kill a file anywhere in the pc If File is present

    Sir
    Actually I have to delete the files multiple times & Daily i will delete it via code & that's why I am looking for the code

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,400

    Re: Kill a file anywhere in the pc If File is present

    This code will find the file. It is not a complete project for you, in that it does not include code to delete the file once it is found. With this code you
    have 98% of your project. You can add the needed 'delete' code for your purposes.

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. vba kill file
    By john_cash in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2022, 04:03 PM
  2. Save zip file from web Open CSV inside WinZip WinRar file and later kill zip or rar
    By analystbank in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2021, 05:41 AM
  3. [SOLVED] Kill file bloat
    By BRISBANEBOB in forum Excel General
    Replies: 4
    Last Post: 06-08-2016, 07:06 PM
  4. [SOLVED] Save as then Kill old file
    By amoxia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2013, 11:48 PM
  5. Kill Command Crashes if File is Not There
    By Vladamir in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2012, 06:10 PM
  6. [SOLVED] Kill file
    By EW in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-16-2006, 10:35 PM
  7. Kill a File
    By Posse John in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2006, 09:30 AM

Tags for this Thread

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