Ports
May 21, 2013, 07:35:37 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: kernel32: Excel VBA: Cannot talk to port >COM4  (Read 1467 times)
IanWade
Member
*
Posts: 2


« on: November 12, 2011, 05:10:59 pm »

I am writing Excel VBA code for serial I/O, with Windows XP and kernel32, using the code example from http://dev.emcelettronica.com/serial-port-communication-excel-vba.

This works fine for COM1 thru COM4. No problems. But when I attempt to address any port number greater than COM4, the "CommOpen"  function returns a lngStatus value of 9, which I take to mean "invalid port number".

Near the bottom of the same page, someone says that by changing the root of the port name from "COM" to "\\.\COM" you can use up to COM256. But I can't make this work.

Has anyone here made it work?

--
Ian
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1627


WWW
« Reply #1 on: November 13, 2011, 11:00:39 am »

Did you increase the value of MAX_PORTS?

Jan
Logged
IanWade
Member
*
Posts: 2


« Reply #2 on: November 13, 2011, 12:55:17 pm »

Did you increase the value of MAX_PORTS?

Jan

Er, no. I was concentrating on the requirements for passing parameters to kernel32, and missed that particular line.  Roll Eyes Thanks Jan.

Ian
« Last Edit: November 13, 2011, 01:01:54 pm by IanWade » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!