Visualizzazione dei risultati da 1 a 2 su 2

Discussione: VBA Socket-Win7

  1. #1

    VBA Socket-Win7

    Hi, I have a problem with VBA.

    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:



    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



    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

    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.....

    PS: anche in italiano la risposta va bene.
    grazie

  2. #2
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,304

    Moderazione

    Questo è un forum in lingua italiana: se hai un problema specifico, riporta le informazioni del tuo caso in questa lingua (destinando eventuali testi esterni o problemi analoghi a semplici collegamenti).
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.