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
-
Searching for several parameters with one dropdown selection
by egallen (1 replies)
-
VBA macro Help-plzzzzzzzzzzzzzzzzzzzzzz
by Uncle (2 replies)
-
Enable Formula Audting in an Excel Workbook where all the sheets are protected
by raviarul (0 replies)
-
Listing table in Access VIA code
by merkava (1 replies)
-
How to deal with the brackets?
by jitender.gupta007 (1 replies)
This thread is for discussions of Delete Selected Files.