The code is nearly identical to that from the help file
but I'm getting an Invalid procedure call or argument
(error number 5) when I'm iterating through directories
with this code:
=========================================================
=========================================================
Where AddFolder is a procedure but the exception occurs in
the calling Dir function to get the next directory
(MyName=Dir). Does anyone have any ideas why this
exception is occurring and any workarounds?
Thanks
Bill N
but I'm getting an Invalid procedure call or argument
(error number 5) when I'm iterating through directories
with this code:
=========================================================
Code:
MyPath = sFileStart
'Retrieve the first entry.
MyName = Dir(MyPath, vbDirectory)
Do While MyName <> ""
If MyName <> "." And MyName <> ".." Then
If (GetAttr(MyPath & MyName) And vbDirectory) =
vbDirectory Then
AddFolder lngShareID, lngPrtID, MyName, sPath,
sMask
End If
End If
MyName = Dir ' Get next entry.
Loop
Where AddFolder is a procedure but the exception occurs in
the calling Dir function to get the next directory
(MyName=Dir). Does anyone have any ideas why this
exception is occurring and any workarounds?
Thanks
Bill N