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
</ip>
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