Guest User

Untitled

a guest
May 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Option Explicit
  2.  
  3. Function FileDelete(Filename As String) As String
  4. Dim fso As New FileSystemObject
  5. On Error Resume Next
  6. Err.Clear
  7. Call fso.DeleteFile(Filename)
  8.  
  9. On Error GoTo 0
  10. If Err.Number <> 0 Then
  11. FileDelete = "Error: " & Err.Number & " " & Err.Description
  12. End If
  13.  
  14. FileDelete = "Deleted."
  15. End Function
  16.  
  17. Function FileExists(Filename As String)
  18. Dim fso As New FileSystemObject
  19. FileExists = fso.FileExists(Filename)
  20. End Function
  21.  
  22. Function FileSize(Filename As String) As Long
  23. Dim fso As New FileSystemObject
  24. Dim f As File
  25. Set f = fso.GetFile(Filename)
  26. FileSize = f.Size
  27. End Function
Add Comment
Please, Sign In to add comment