I am trying to write code to delete a file if it exists. This is the code that I'm using, but I get an error that says "file not found". What am I doing wrong?
Thanks, Rick Ruscin
Private Sub Command1_Click()
Dim CreditFile As String
Set fs = CreateObject("Scripting.FileSystemObject"
CreditFile = ("C:\Program Files\SSM\001\Credit"
If CreditFile <> "" Then
fs.DeleteFile "C:\Program Files\SSM\001\Credit"
Else
End If
End Sub
Thanks, Rick Ruscin
Private Sub Command1_Click()
Dim CreditFile As String
Set fs = CreateObject("Scripting.FileSystemObject"
CreditFile = ("C:\Program Files\SSM\001\Credit"
If CreditFile <> "" Then
fs.DeleteFile "C:\Program Files\SSM\001\Credit"
Else
End If
End Sub