Dim fso, filespec, MyReturn
filespec = ("C:\Test\vbsample.xlsx") ' testfile1.txt") 'C:\Test\testfile
Set fso = CreateObject("Scripting.fileSystemObject")
Set fsosize = fso.Getfile(filespec)
MyReturn = " Name Is: " & fsosize.Name & "file size Is : " & fsosize.Size
MyReturn1 = fsosize.Size
MsgBox MyReturn1
If (MyReturn1 > 1) Then
MsgBox " File have Data so Don't Delete the file"
Else
MyReturn = fso.Deletefile(filespec)
MsgBox " file Deleted"
End If
No comments:
Post a Comment