Hi all, I have a problem with VBA. I would be very grateful if someone could help me.
Let me explain it:
- I have written a simple Macro in Excel 2003 which is able to open Matlab and communicate with it by means of a socket. Here is the relevant part of the code:IT WORKS using Excel 2003, Matlab R2007b and WINDOWS XPvb Code:
Public WithEvents Sock As MSWinsockLib.Winsock Private Sub CommandButton1_Click() Call createServSocket(9000) 'lunch file Shell ("C:\xxx") End Sub Public Sub createServSocket(port As Integer) Set Sock = New MSWinsockLib.Winsock Sock.Protocol = sckTCPProtocol Sock.LocalPort = port Sock.Listen End Sub
the same code with the same version of Excel and Matlab but with WINDOWS 7 doesn't work! It gives me a runtime error 429. ActiveX can't create the object on this linevb Code:
Set Sock = New MSWinsockLib.Winsock
I tried to:
- add MSWINSCK.OCX and register it
- add dao360.dll and register it
- add reference to Microsoft Winsock Control 6.0
- add reference to DAO library
but I couldn't find out why it doesn't work!
Do you have any idea?
please, help me.....




Reply With Quote