Hi all,
i am trying to get folder size on a network drive and coming up with a Path not found error, please see below code:
Set fso = CreateObject("Scripting.FileSystemObject")
Set fso2 = CreateObject("Scripting.FileSystemObject")
sql = "Select [Server Name] from Table "
set rs = db.openrecordset(sql)
With rs
Do while not .EOF
Set ObjSource = fso.GetFolder(.Fields(0).Value)
For each ObjFolder in ObjSource.SubFolders
'*****i Have tried:
iSize = ObjFolder.Size
'**** and i have tried
iSize = fso2.GetFolder(.Fields(0).Value & "\" & ObjFolder.Name & "\").Size
'**** and i have tried
iSize = fso2.GetFolder(ObjFolder.Name & "\").Size
Next
.MoveNext
Loop
End With
....
It fails on certain folders not all of them...I have checked if the folder exists and its there.
I have also copied the name from vba and tried to open it myself in windows and it opens.
i even can get the size of the folder from windows.
Any help is appreciated
i am trying to get folder size on a network drive and coming up with a Path not found error, please see below code:
Set fso = CreateObject("Scripting.FileSystemObject")
Set fso2 = CreateObject("Scripting.FileSystemObject")
sql = "Select [Server Name] from Table "
set rs = db.openrecordset(sql)
With rs
Do while not .EOF
Set ObjSource = fso.GetFolder(.Fields(0).Value)
For each ObjFolder in ObjSource.SubFolders
'*****i Have tried:
iSize = ObjFolder.Size
'**** and i have tried
iSize = fso2.GetFolder(.Fields(0).Value & "\" & ObjFolder.Name & "\").Size
'**** and i have tried
iSize = fso2.GetFolder(ObjFolder.Name & "\").Size
Next
.MoveNext
Loop
End With
....
It fails on certain folders not all of them...I have checked if the folder exists and its there.
I have also copied the name from vba and tried to open it myself in windows and it opens.
i even can get the size of the folder from windows.
Any help is appreciated