0

is there any way how to send a string from Excel VBA to the specific IP address with a port? I tried MSXML2.XMLHTTP60, but there cant add IP, only URL.

Lolcoman
  • 11
  • 2
  • If you are using a 32-bit version of Excel/Office then you can use the WinSock API (or a wrapper like OstroSoft Winsock: http://ostrosoft.com/oswinsck.aspx) See also: https://stackoverflow.com/questions/65528189/how-to-use-winsock-control-in-excel-vba – jacobq Nov 21 '22 at 20:33
  • But what, when I use a 64-bit? It working only on 32-bit? @jacobq – Lolcoman Nov 21 '22 at 20:39
  • I am also seeking a 64-bit solution...if I had it figured out I would share it (sorry). See also https://stackoverflow.com/questions/64240586/vba-excel-365-64-bit-winsock-implementation-problem & https://stackoverflow.com/questions/65528189/how-to-use-winsock-control-in-excel-vba/74524642#74524642 – jacobq Nov 21 '22 at 20:41
  • It's sad :( Is there another way how to do that? – Lolcoman Nov 21 '22 at 20:47
  • I believe it is possible to use low-level APIs like [`Ws2_32.dll`](https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-start-page-2) or https://stackoverflow.com/questions/64240586/vba-excel-365-64-bit-winsock-implementation-problem, but it looked too cumbersome to justify for me, so I used a commercial offering (https://www.modbustools.com/ since I needed ModbusTCP) some others I found: https://sockettools.com/activex-edition-development/ https://www.dart.com/products/powertcp-winsock-for-activex#tcp-activex-control https://www.example-code.com/excel/socket_connect.asp – jacobq Nov 21 '22 at 22:29

0 Answers0