Check file exists on SharePoint via VBA


I want to check if the file exists on SharePoint location or not.
I’ve found this VBA on stackoverflow but didn’t work:

Function checkFile(URLStr As String) As Boolean
    Dim oHttpRequest As Object
    Set oHttpRequest = New MSXML2.XMLHTTP60
    With oHttpRequest
        .Open "GET", URLStr, False, [Username], [Password]
        .setRequestHeader "Cache-Control", "no-cache"
        .setRequestHeader "Pragma", "no-cache"
        .setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
    End With
    If oHttpRequest.Status = 200 Then
        checkFile = True
        checkFile = False
    End If
End Function

Please let me how I can use this in UiPath.

Thanks in advance…