Library code snippets
Delete Selected Files
By Neil Derek, published on 22 Feb 2002
Files are stored in a sub-directory of 'Stox', an application I created. The files to delete are all called PL???.XLS and are part of a stock control program.
Sub DeleteStockFile()
strPath = "c:\program files\stox\plists\pl" ' the folder path & file prefix to the files
strItemNum = InputBox("Enter Picking List No. i.e. 50", "Picking List Number")
strFileName = strPath & strItemNum & ".xls"
On Error GoTo Error_Handler
Kill strFileName
Exit Sub
Error_Handler:
MsgBox "Error deleting file..."
End Sub
Related articles
Related discussion
-
How to control IE from VBA
by NaseemAhmed (0 replies)
-
Excel 2007 Error : ' the digital signature is deleted when Excel users tries to save the Master Excel Spreadsheet.'
by jdierkes (0 replies)
-
Excel VBA transposition problem
by KDHTSVAU (2 replies)
-
excell question
by Uncle (11 replies)
-
Question about subforms
by ginwah (0 replies)
This thread is for discussions of Delete Selected Files.