G
Guest
here is my code currently
Public Function DeleteReports2()
On Error GoTo errTrap
Dim rtfPath As String
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "CCGA.xls"
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "MTEN.xls"
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "NPAT.xls"
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "MWCT.xls"
exitTrap:
On Error Resume Next
Exit Function
errTrap:
Select Case Err.Number
Case Is = 53
MsgBox "No files to delete in folder: " & vbCrLf & rtfPath,
vbExclamation
Resume exitTrap
Case Else
MsgBox Err.Number & " " & Err.Description, vbCritical
Resume exitTrap
End Select
End Function
the problem is that if one of the .xls files aren't out there then the code
bombs out -- i want this to delete the files out in the folder (all but one
file - template) and if the files are not out there to continue on to the
other files
Please help!
Thank you
Public Function DeleteReports2()
On Error GoTo errTrap
Dim rtfPath As String
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "CCGA.xls"
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "MTEN.xls"
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "NPAT.xls"
rtfPath = "X:\Distribution Projects\XL\"
Kill rtfPath & "MWCT.xls"
exitTrap:
On Error Resume Next
Exit Function
errTrap:
Select Case Err.Number
Case Is = 53
MsgBox "No files to delete in folder: " & vbCrLf & rtfPath,
vbExclamation
Resume exitTrap
Case Else
MsgBox Err.Number & " " & Err.Description, vbCritical
Resume exitTrap
End Select
End Function
the problem is that if one of the .xls files aren't out there then the code
bombs out -- i want this to delete the files out in the folder (all but one
file - template) and if the files are not out there to continue on to the
other files
Please help!
Thank you