K
ksjent
Hi everybody!
I'm new here and I desperatly need help. With the following function I
try to see a a device:
Public Function PortTest(COMPortNummer As Integer) As Boolean
MSComm1.CommPort = COMPortNummer
On Error Resume Next
MSComm1.PortOpen = True
If Err = 0 Then
PortTest = True
MSComm1.PortOpen = False
Else
PortTest = False
MSComm1.PortOpen = False
End If
End Function
For Portzaehler = 1 To 16
If PortTest(Portzaehler) Then
MsgBox "COM" + Str(Portzaehler) + " verfügbar"
End If
Next
The problem is that the compiler says to me that the command
"MSComm1." is error. It seems that I have to put a definition, and I
have no clue how to do it. I'm not a programmer, but I urgently need a
solution. Might it be that I have to add a line like "MSComm1.CommPort
= 1", and if yes, where to put it? Thank you for any kind of help!
Best wishes, Gremlin
I'm new here and I desperatly need help. With the following function I
try to see a a device:
Public Function PortTest(COMPortNummer As Integer) As Boolean
MSComm1.CommPort = COMPortNummer
On Error Resume Next
MSComm1.PortOpen = True
If Err = 0 Then
PortTest = True
MSComm1.PortOpen = False
Else
PortTest = False
MSComm1.PortOpen = False
End If
End Function
For Portzaehler = 1 To 16
If PortTest(Portzaehler) Then
MsgBox "COM" + Str(Portzaehler) + " verfügbar"
End If
Next
The problem is that the compiler says to me that the command
"MSComm1." is error. It seems that I have to put a definition, and I
have no clue how to do it. I'm not a programmer, but I urgently need a
solution. Might it be that I have to add a line like "MSComm1.CommPort
= 1", and if yes, where to put it? Thank you for any kind of help!
Best wishes, Gremlin