Network error to post files via VBA: " Multiple connections" error

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
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top