Results 1 to 7 of 7

Thread: [VBA-win7]

Threaded View

  1. #1
    New Member
    Join Date
    Jul 10
    Posts
    7

    [VBA-win7]

    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:
    vb Code:
    1. Public WithEvents Sock As MSWinsockLib.Winsock
    2. Private Sub CommandButton1_Click()
    3.     Call createServSocket(9000)
    4.     'lunch file
    5.     Shell ("C:\xxx")
    6. End Sub
    7.  
    8. Public Sub createServSocket(port As Integer)
    9.     Set Sock = New MSWinsockLib.Winsock
    10.     Sock.Protocol = sckTCPProtocol
    11.     Sock.LocalPort = port
    12.     Sock.Listen
    13. End Sub
    IT WORKS using Excel 2003, Matlab R2007b and WINDOWS XP

    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 line
    vb Code:
    1. 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.....
    Last edited by Hack; Jul 14th, 2010 at 06:31 AM. Reason: Added Highlight Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •