rhino4eva
Active Member
- Joined
- Apr 1, 2009
- Messages
- 262
- Office Version
- 2010
- Platform
- Windows
Sub opensezAme(sPATH, sDrive As String)
Dim TPATH As Object
Set TPATH = CreateObject("WScript.Network")
On Error Resume Next
TPATH.MapNetworkDrive sPATH, sDrive
End Sub
------------------------------------------------------
Sub closesezAme(sDrive As String)
Shell "net use " & sDrive & ": /delete /y"
End Sub
------------------------------------------------------
Sub openup()
Call opensezAme("T:", "\\tpslth\hfs\mic")
Call opensezAme("Z:", "\\pcr\micropcr$")
End Sub
------------------------------------------------------
Sub closeup()
Call closesezAme("T")
Call closesezAme("Z")
End Sub
------------------------------------------------------
as you can see I have 4 subs one of which is a variable controlled engine.
I need to modify the "on ERROR" line to detect if the drives are all ready mapped and If so run CLOSEUP then run OPENUP
I don't know enough about error config so any help would be appreciated
Dim TPATH As Object
Set TPATH = CreateObject("WScript.Network")
On Error Resume Next
TPATH.MapNetworkDrive sPATH, sDrive
End Sub
------------------------------------------------------
Sub closesezAme(sDrive As String)
Shell "net use " & sDrive & ": /delete /y"
End Sub
------------------------------------------------------
Sub openup()
Call opensezAme("T:", "\\tpslth\hfs\mic")
Call opensezAme("Z:", "\\pcr\micropcr$")
End Sub
------------------------------------------------------
Sub closeup()
Call closesezAme("T")
Call closesezAme("Z")
End Sub
------------------------------------------------------
as you can see I have 4 subs one of which is a variable controlled engine.
I need to modify the "on ERROR" line to detect if the drives are all ready mapped and If so run CLOSEUP then run OPENUP
I don't know enough about error config so any help would be appreciated