Given the following snippet:
Dim s As String: s = \"S:\\vic\\bla\\[..insert more here..]\\data.xml\"
Debug.Print Len(s)
Debug.Print Dir(s)
I have no means of testing this, so all you have is a few rough notes on a possible approach.
''Reference: Windows Script Host Object Model
Dim fs As New FileSystemObject
Dim fl As Folder
Dim fl2 As Folder
Set fl = fs.GetFolder("Z:\Docs\test\ThisIsInOrderToCreate\ALongFilePath\")
Set fl2 = fl.SubFolders("WithASubFolder")
Debug.Print fl2.ShortPath
For Each File In fl2.Files
If File.Name = "file.txt" Then
Debug.Print "Found"
End If
Next
''May be possible
a = Dir(fl.ShortPath & "\file.*")
Also, regarding comment above:
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "L:", "\\mydrive\share"
''Important to destroy when you are finished
Set WshNetwork = Nothing