Results 1 to 7 of 7

Thread: [TIME-CRITICAL] TCP/IP over VBA

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2015
    Posts
    4

    [TIME-CRITICAL] TCP/IP over VBA

    Hello,

    we have an application in our company which we wrote in VBA for simple TCP/IP communication to a Server of a different company.

    We always used the MS Winsock Component and initialized it over the code with:

    Code:
    Dim Socket as Object
    
    '...
    
    Set Socket = CreateObject("MSWinSock.Winsock")
    This has worked fine since we cant provide VB6.
    The cusomter is getting a Run-time error '429': ActiveX component can't create object error.

    The Project should be finished in a few days and i really need a solution for this. If we could use the MSWinSock component anyways (without using it on a form) it would be great! For any other solutions we are thankful too

  2. #2
    PowerPoster
    Join Date
    Oct 2010
    Posts
    2,141

    Re: [TIME-CRITICAL] TCP/IP over VBA

    I believe that the Winsock control is part of VB6, so it is unlikely that it would exist on your customer's system.

    Perhaps you can use the XMLHTTP object. see: Loading information from the internet using the XMLHTTP Object for an example.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2015
    Posts
    4

    Re: [TIME-CRITICAL] TCP/IP over VBA

    Yeah, this is why we are also looking for alternatives.

    Would really appreciate to hear some of your meanings

    Greetings from switzerland

    Edit: We have to use the TCP/IP Protocol so the XMLHTTP object will not work for us, but thanks anyways
    Last edited by SmoothDev; Mar 17th, 2015 at 01:19 PM.

  4. #4
    PowerPoster
    Join Date
    Oct 2010
    Posts
    2,141

    Re: [TIME-CRITICAL] TCP/IP over VBA

    Do you have any VB.Net or C# programmers on staff? If so, you could use the .Net libraries to provide the communication and wrap that functionality in an ActiveX control. see: Microsoft InteropForms Toolkit 2.1

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2015
    Posts
    4

    Re: [TIME-CRITICAL] TCP/IP over VBA

    Hi,

    Yeah, we are specialized on .NET (C#) and Delphi.
    The application we have to write in VBA is not in Office but in GraphWorkX32 - but its almost the same VBA as in Office.

    The Problem is, the cusomer doesnt want to have dependencies like VB6 or .NET. And it looks like VBA just doesnt provide a good solution so ill simply write an external console application in Delphi which runs native and sends/reads the commands from the TCP Server over the Indy Components.

    I guess i have no other choice, but atleast i dont have to use this annoying language anymore
    Thanks alot for your time
    Last edited by SmoothDev; Mar 17th, 2015 at 10:45 PM.

  6. #6
    Fanatic Member dmaruca's Avatar
    Join Date
    May 2006
    Location
    Jacksonville, FL
    Posts
    577

    Re: [TIME-CRITICAL] TCP/IP over VBA

    You can use the example in my signature to read back in success/failure if you go the exe DOS route. I would definitely either use exe or dll instead of ocx since that would mean you would need administrative privileges to get the ocx set up on the target machines. That could kill your project in some companies that have very strict policies.

    Edit: of course dll then has to worry about 32/64 bit
    Last edited by dmaruca; Mar 23rd, 2015 at 08:57 AM.

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2015
    Posts
    4

    Re: [TIME-CRITICAL] TCP/IP over VBA

    Hello and thanks for replying.

    I sovled the problem by creating a Console Application in Delphi which takes the Startparameters and generates a TCP Connection, sends the Query to the server and returning an ExitCode with its result.

    Im still using VBA in this project but only for the UserInterface to communicate with the console application.

    There is no problem with it (yet)

Posting Permissions

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



Click Here to Expand Forum to Full Width