1. B

    kill an open Excel file

    Hi guys, I just want to kill a file even if he is open. I saw on forums that i just need to save file before kill it but doesn't work i have the error 70 permission denied. Someone know how to do that ? Sry for my english i am a young french boy who just want learn vba :D Here is my code : Sub...
  2. H

    Conditionally delete files by Vba

    I have to delete this file But there is a condition Kill "C:\Users\WolfieeeStyle\Desktop\1.xls" Kill "C:\Users\WolfieeeStyle\Desktop\2.xls" Kill "C:\Users\WolfieeeStyle\Desktop\3.xls" If there is kill.xlsb in this path C:\Users\WolfieeeStyle\Desktop then only kill all that files and if it is...
  3. C

    excel vbscript for command button to retry script

    So my workbook has a lot of script in it and I use "Bundles" of script to perform big functions, one such function that resides in a bundle of scripts reaches to SAP through GUI Scripting and pulls data. It is set to use an active window not with hard coded user and password info so if the user...
  4. D

    How yo Kill File Path has Unsupported Language ?

    Greetings How to VBA read "C:\Users\User\desktop\ملف عربي.xlsx" it converts "ملف عربي" to "??? ????" Sub KillFile() dim FilePath as string FilePath= "C:\Users\User\desktop\ملف عربي.xlsx" Kill FilePath end sub Sub KillFile() Dim FilePath As String FilePath = "C:\Users\User\desktop\...
  5. D

    How to Kill Excel using note pad and task scheduler

    Hello everyone, :laugh::laugh: I have a bunch of stuff running on my task scheduler and sometimes something with my excel programs will get hung up which causes all other programs to stop as well. I was looking online and found that it might be possible to use 'Notepad' to kill excel and have...
  6. sharky12345

    Error 70 Permission Denied

    I'm randomly getting an error 70, Permission Denied when I try to execute the following routine; Sub DeleteFiles() 'Raw Data If FileFolderExists(ThisWorkbook.Path & "\Toolbox Files\System Files\Raw Data*.xlsx") Then Kill ThisWorkbook.Path & "\Toolbox Files\System Files\Raw...
  7. C

    Kill Workbook Error

    Hello! I am trying to write a macro that will delete the entire workbook from my desktop if both sheets "100" and "MISC" have no data. I keep getting a runtime error on the "Kill wb" line. Any thoughts? Sub Macro1() Dim wb As Workbook Dim Test100 As Object Dim TestMISC As Object Set wb =...
  8. L

    Kill Function will not delete the file

    Looks fairly simple - Code runs just like it knows what to do and then nothing File resides on Desktop and .Fullname does return the correct path tempFileName = targetWorkbook.FullName 'MsgBox "Target Workbook Name = " & tempFileName targetWorkbook.Save targetWorkbook.Close...
  9. S

    VBA Kill statement Error 13 Type mismatch in 2016 x64

    I'm troubleshooting yet another 2016 issue in which I have Kill statements in VBA to delete files, which has historically worked perfectly on 2013, yet now fails in 2016, and for the life of me I cannot figure out why. To troubleshoot I've created a new Excel file and am running this test code...
  10. M

    Kill temp files vba

    Hi all, I have a code in my macro to kill all existing .tmp files. This code works fine when it is used in a directory with less files, however, when I use it in a directory with, lets say, more than 20 files then it does not execute the kill function. When I go through my code with f8, then it...
  11. P

    Help using variable in KILL command file path

    Hello, I made a macro to save a file with todays date in a folder. I'll be doing this everyday and I don't want the folder to fill with workbooks. I would like to keep yesterdays and delete the file dated the day before yesterday. Also If anyone can give me a tip for adding in holidays to the...
  12. R

    Permission Denied - Kill File - Workbook Open Event

    Hi there Excel Masters, My file contains a function to Delete & replace itself for its latest version. This function can be accessed by a button on one of the sheets; or everytime I open the workbook. This function works perfectly if I trigger it from the button on the sheets, but if it is...
  13. F

    Excel 2010 VBA - Unable to Kill Files

    OS Windows 7 Excel 2010 Requirement to delete a number of Files(Not just Excel Files) in different folders. These files and their fully qualified paths are listed in an Excel Workbook. When I run my code it to perform the deletion it functions well for about 80% of the files. The other 20%...
  14. M

    Resolved: What if the file i want to delete has already been deleted ("kill" macro)?

    I'm using the following macro: Private Sub Workbook_BeforeClose(Cancel As Boolean) Kill "T:\usequty\Audit Reporting\T-Cross Reports\tcross.xls" End SubThe marco is working well, but it is very possible that the file has already been deleted. In such cases, I do not want the error to come up...
  15. S

    How To Kill Files in Folders Named in Cell?

    I use 'FileCopy Source:=' and 'Destination:=' functions to copy files named in cell (column B) from folders named in cell (column A) to another folders named in another cell (column C) which I want to rename them (named in column D). Sub Copy_Files() Range("A1").Select Range(Selection...
  16. S

    loops to kill files

    I am new to loops inside VBA. but I do understand the concept behind them. Situation: I have a list of folders: (will call this variable: foldername) c:\documents\FolderA c:\documents\FolderB c:\documents\FolderC every weekdday I save a folder inside each of the folders with the date as...
  17. S

    "on error" command not exiting if loop

    I want to look and see if a file exists (based on a date entered into an input box). If the file exists, I want to delete the file. If the file does not exist, I want the macro to move onto the next line without an error message. The code below works when the file exists but gets stuck on the...
  18. M

    Kill file

    Hi, I've got a sheet that I need to convert certain rows into CSV for a payroll package. I'm using excel 2003 on XP. I have worked out a macro to save it as a csv file with a different name. The only way I managed to do this was by creating an xls file with the data I wanted and then saving it...
  19. D

    Kill only excel files

    I would like a macro to kill only all excel files in all the directories in my computer. Can anyone write the procedure to do this. Thanks very much.

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back