CommPort

Sets and returns the communications port number. You can set this value to any number between 1 and 16 at design time (the default is 1). However, the Comm control generates error 68 (Device unavailable) if the port does not exist when you attempt to open it with the PortOpen property.

Sets and returns the communications port number.

Syntax

object.CommPort[ = value ]

The parts of the CommPort property syntax are described in the following table.

Part Description
object An object expression that evaluates to an object.
value A integer value specifying the port number.

Remarks

You can set value to any number between 1 and 16 at design time (the default is 1). However, the Comm control generates error 68 (Device unavailable) if the port does not exist when you attempt to open it with the PortOpen property.

Note You must set the CommPort property before opening the port.

Data Type

Integer