Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Delete a Saved Workbook

Status
Not open for further replies.

Kaulana

Technical User
Jul 31, 2001
24
0
0
US
There should be a way to delete workbooks from folders using VBA, but darned if I can find it. Am I blind, or is there no way to do it in VBA in Excel? Is there a way to do it within MS Office? Kaulana (aka Bob)
 
consider:

a = Dir("C:\Production Files\REPORT_SF_LABOR.txt")
If a <> &quot;&quot; Then
Kill &quot;C:\Production Files\REPORT_SF_LABOR.txt&quot;
End If


If I'm way off on this email me at
drat@mediaone.net
 
Thanks, ratman, you were right on. I remember the Kill command now. I wonder why requests of the VBA help files on how to delete a workbook wouldn't have brought that right up? Thanks for the quick reply. Kaulana (aka Bob)
 
just a note,
be careful how you use this - I put this in a loop and it caused my virus scanner to report a virus! I thought a virus had infected my code but it turned out to be the sub with the kill statement. I gave the admins a bit of a fright though :)
D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top