I have a vb program which connects to a network share , from where I
read the data files in the subfolders of the share.
I use the following code to map the network drive.
sChkRetValue = Shell(sMapDriveConnect)
DoEvents
Sleep (2000)
Dim sMapDriveDelete As String, sMapDriveConnect As String,
sChkRetValue As Double
On Error GoTo ErrHandler
sMapDriveConnect="net use L: \\ldabsesmbsrv.abc.test.com\oceansrc
pwd1/user:xyz"
sMapDriveConnect = GetDataFromINI("GENERAL", "MapDriveConnect")
sChkRetValue = Shell(sMapDriveConnect)
DoEvents
Sleep (2000)
ConnectToNWDrive = 1
Exit Function
ErrHandler:
App.LogEvent "History Tool: GBP Swaption: ConnectToNWDrive - " &
"[" & Err.Number & "] " & Err.Description
ConnectToNWDrive = -1
Only if this is succesful I continue to folder access using the
following code.
sFolderPath="L:\databrowser\data\Vols\Swap\test"
Set objFileSys = New FileSystemObject
Set objFolder = objFileSys.GetFolder(sFolderPath)
DoEvents
For Each objFile In objFolder.Files
...
next
But I'm getting [76] Path not found in the line where I execute
Getfolder method above.
Earlier I was getting this error in the line where I execute shell
command to map the network drive also.
I added the DoEvents and Sleep statements and it seems to work fine
now..
Please let me know a solution to fix the problem.