John Schroeder
New Member
- Joined
- Jul 11, 2011
- Messages
- 27
Trying to post excel and pdf to shared network with a generic user/pword. Getting Multiple connections error. Error is run time error "Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. Application is not used often when concurrent use would be an issue. We have error handling to email file when occurs. The problem is intermittent. Anything that can be done before run?
'map network drive with generic permanent user id
If TabFileName = "OH Line Calculator" Then
ServerShare = "\\AAAA\Shared3\CIAC Models\NIMO\UNY_Elec_OHL"
ElseIf TabFileName = "Primary UG 1 Phase Lateral" Then
ServerShare = "\\BBBBBB\Shared3\CIAC Models\NIMO\UNY_PrimaryUG_1Ph"
ElseIf TabFileName = "Primary UG 3 Phase Lateral" Then
ServerShare = "\\CCCCCC\Shared3\CIAC Models\NIMO\UNY_PrimaryUG_3Ph"
ElseIf TabFileName = "UCD Dist Ext Calculator" Then
ServerShare = "\\DDDDDD\Shared3\CIAC Models\NIMO\UNY_UCD"
End If
UserName = "nmpc\YYYYYYY"
Password = "XXXXXXX"
Set NetworkObject = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
'This insures you find a empty drive letter
For i = 67 To 90
netDrive = Chr(i) & ":"
If Not fso.DriveExists(netDrive) Then Exit For
Next
NetworkObject.MapNetworkDrive netDrive, ServerShare, False, UserName, Password
'map network drive with generic permanent user id
If TabFileName = "OH Line Calculator" Then
ServerShare = "\\AAAA\Shared3\CIAC Models\NIMO\UNY_Elec_OHL"
ElseIf TabFileName = "Primary UG 1 Phase Lateral" Then
ServerShare = "\\BBBBBB\Shared3\CIAC Models\NIMO\UNY_PrimaryUG_1Ph"
ElseIf TabFileName = "Primary UG 3 Phase Lateral" Then
ServerShare = "\\CCCCCC\Shared3\CIAC Models\NIMO\UNY_PrimaryUG_3Ph"
ElseIf TabFileName = "UCD Dist Ext Calculator" Then
ServerShare = "\\DDDDDD\Shared3\CIAC Models\NIMO\UNY_UCD"
End If
UserName = "nmpc\YYYYYYY"
Password = "XXXXXXX"
Set NetworkObject = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
'This insures you find a empty drive letter
For i = 67 To 90
netDrive = Chr(i) & ":"
If Not fso.DriveExists(netDrive) Then Exit For
Next
NetworkObject.MapNetworkDrive netDrive, ServerShare, False, UserName, Password