|
-
Feb 18th, 2000, 11:55 AM
#1
How can you check the status of a comm port if it is open or closed? I thought comm1.portopen would return the status, but its not. It always returns false. The simpliest way, I just want to know if the comm port is in use or not.
Thanks..
-
Feb 18th, 2000, 02:43 PM
#2
PowerPoster
The PortOpen property should return the port status. e.g.
If MSComm1.PortOpen = True Then
MsgBox "Port is Open"
Else
MsgBox "Port is Closed"
End If
If that still doesn't work, try and open the comm port. If it is already open, it produces a trappable error, e.g.
On Error GoTo OhDear
MSComm1.PortOpen = True
Exit Sub
OhDear:
If Err.Number = 8005 Then
MsgBox "Port is already open!"
Else
MsgBox Err.Description
End If
Hope that helps,
------------------
- Chris
[email protected]
Q. Why do mice have small balls?
A. Not that many know how to dance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|