ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting Files From VBA (https://www.excelbanter.com/excel-programming/283272-deleting-files-vba.html)

Brett[_4_]

Deleting Files From VBA
 
As part of a macro I'm writing in EXCEL via VBA I need to
delete a file from a specfic location. Any Help?

Dan E[_3_]

Deleting Files From VBA
 
Try using Kill

Kill("C:\My Documents\File I don't need.xls")

Dan E

"Brett" wrote in message ...
As part of a macro I'm writing in EXCEL via VBA I need to
delete a file from a specfic location. Any Help?




Tom Ogilvy

Deleting Files From VBA
 
On Error Resume Next
kill "C:\My Documents\Myfile.xls"
On Error goto 0

--
Regards,
Tom Ogilvy

"Brett" wrote in message
...
As part of a macro I'm writing in EXCEL via VBA I need to
delete a file from a specfic location. Any Help?




Henry[_5_]

Deleting Files From VBA
 
Brett,

Look up KILL in XL VBA help

HTH
Henry


"Brett" wrote in message
...
As part of a macro I'm writing in EXCEL via VBA I need to
delete a file from a specfic location. Any Help?





All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com