Winsock library on Windows 10

VacoBeginner

New Member
Joined
Jan 13, 2016
Messages
22
Hi

I'm trying to build a solution in excel that will enable 2 excel workbooks on 2 different computer to chat with each other. I have download this solution from a blogg and it needs winsck.ock (WinsockLib) to be chosen under Tool/References.

Unfortunately, I get an error when trying to call and create a TCP server.

Does anyone know if Winsock is needing any other settings? It's active in VBA Editor, since I get selections after writing the . in New MSWinsockLib

The program stops in this line

Code:
 Set tcpServer = New MSWinsockLib.Winsock

Code:
Private Sub cmdBeginListen_Click()
    isConnect = Not isConnect
    
    If isConnect Then
        
        Set tcpServer = New MSWinsockLib.Winsock
        tcpServer.LocalPort = 1200
        
        tcpServer.Listen
        
        cmdBeginListen.Caption = "Server Listening..."
        cmdBeginListen.BackColor = COLOR.COLOR_IS_GREEN
    
        Me.Caption = "Main - <ip>" & tcpServer.LocalIP & ":
" & tcpServer.LocalPort
    Else
        tcpServer.Close
        Set tcpServer = Nothing
        
        Dim frm As Object
        For Each frm In UserForms
            If UCase(TypeName(frm)) = "FRMSERVER" Then Unload frm
        Next
      
        cmdBeginListen.Caption = "Begin Listen"
        cmdBeginListen.BackColor = COLOR.COLOR_IS_RED
    
        Me.Caption = "Main"
    End If
End Sub
</ip>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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