I am trying to use winsock control (MSWINSCK.OCX produced with VB6) in my Excel. Here are what I have done:
1, download MSWINSCK.ocx from internet, copy to c:\windows\SysWOW64
2, run regsvr32 C:\Windows\SysWOW64\MSWINSCK.OCX with administrator successfully
3, import below registry file according to suggestion from internet:
REGEDIT HKEY_CLASSES_ROOT\Licenses = Licensing: Copying the keys may be a violation of established copyrights.
// Winsock Control 6.0 license key HKEY_CLASSES_ROOT\Licenses\2c49f800-c2dd-11cf-9ad6-0080c7e7b78d = mlrljgrlhltlngjlthrligklpkrhllglqlrk
4, open my Excel visual basic windows
5, insert a user form
6, from tools->reference, browse the above .ocx file, and select Microsoft Winsock Control 6.0
7, put a commandbutton onto the userform, double click it to add below codes:
Dim tcpclient As New Winsock
tcpclient.Connect "localhost", 5100
Up to now, everything seems ok. when I input "tcpclient." the system even prompt me with .Accept .Close .Connect .....
Sounds great.
Then I start to run the userform, and I click the commandbutton, then received error: Run Time Error -2147221164(80040154) Class Not Registered
Could you please help me what's wrong?
I need to use the winsock control, in order to connect a TCP server from my Excel.
Thanks a lot!