manman89

VBA - CHECK FILE IS EXISTS OVER LAN

Feb 14th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. VBA CHECK FILE IS EXISTS OVER LAN
  2.  
  3. Private Sub Cmd1_Click()
  4. Dim Checker As Boolean
  5. Checker = CHECK_FILE_IS_EXISTS("\\192.168.1.10\Share\Abcd.docx")
  6. MsgBox Checker
  7. End Sub
  8.  
  9. Function CHECK_FILE_IS_EXISTS(FileX As String) As Boolean
  10. Dim FSO As Object
  11. Set FSO = CreateObject("Scripting.FileSystemObject")
  12. CHECK_FILE_IS_EXISTS = FSO.FileExists(FileX)
  13. End Function
Advertisement
Add Comment
Please, Sign In to add comment