Horje
vba delete file Code Example
vba delete file
' Needs to add "Microsoft Scripting Runtime" reference to your file
Function FileExists(ByVal FileToTest As String) As Boolean
   FileExists = (Dir(FileToTest) <> "")
End Function

Sub DeleteFile(ByVal FileToDelete As String)
   If FileExists(FileToDelete) Then 'See above          
      ' First remove readonly attribute, if set
      SetAttr FileToDelete, vbNormal          
      ' Then delete the file
      Kill FileToDelete
   End If
End Sub




3

Related
write to text file vb.net Code Example write to text file vb.net Code Example
excel vba copy range with filter Code Example excel vba copy range with filter Code Example
shortcut to apply a formula to an entire column in excel Code Example shortcut to apply a formula to an entire column in excel Code Example
xlvba check for folder Code Example xlvba check for folder Code Example
excelvba check for directory Code Example excelvba check for directory Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11