Library code snippets

Delete Selected Files

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

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of Delete Selected Files.

Leave a comment

Sign in or Join us (it's free).

Neil Derek

Want to stay in touch with what's going on? Follow us on twitter!