Private Declare Function WNetConnectionDialog Lib "mpr.dll" _ (ByVal hwnd As Long, ByVal dwType As Long) As Long Private Declare Function WNetDisconnectDialog Lib "mpr.dll" (ByVal hwnd As Long, ByVal dwType As Long) As Long Private Sub Command1_Click() 'Connect LPTx xyz = WNetConnectionDialog(Me.hwnd, 2) End Sub Private Sub Command2_Click() 'Disconnect LPTx xyz = WNetDisconnectDialog(Me.hwnd, 2) End Sub