How to import Winsock in registry file

75 Views Asked by At

I like to use winsock in EXCEL VBA. So far I found quite good instruction in this stackoverflow question, link. I did every step except number three, since I did not know what it meant. Nevertheless, I could load the Microsoft Winsock Control 6.0 bib. Then I tried the following code, using a new document, and I added an userfrom and a command button.

Option Explicit

Private Sub CommandButton1_Click()
    Dim winsock As MSWinsockLib.winsock
    Set winsock = New MSWinsockLib.winsock
    
    winsock.Connect "localhost", 5100
End Sub

But "Set winsock = New MSWinsockLib.winsock" causes a run time error, to precise run-time error 429 "ActiveX component can't create object". Is this because I did not copy the license, as described in the original post? And if yes, how do I do this? I should add, that I am using a 32 bit version of EXCEL.

0

There are 0 best solutions below