Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 20,760 times

Related Categories

Delete Selected Files

Neil Derek

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