How to open a serial port?

  • Thread starter Thread starter babakanoush
  • Start date Start date
B

babakanoush

Guest
Hi,

What is the syntax in VBA to open a serial port and read some data from it? Thanks.
 
If the serial port is, say, COM1 (in old DOS/PC terms), you would use

Open "COM1:" for input as file #1

You need to know the correct device name. Other than that, it is usually pretty simple. However, a word of caution. VBA will treat the action as SYNCHRONOUS - so if there is a long delay associated with the port, your program might appear to go nowhere for a long time.
 

Users who are viewing this thread

Back
Top Bottom