Private Sub Command1_Click()Dim intP As Integer On Error GoTo errSub For intP = 1 To 256 MSComm1.CommPort = intP MSComm1.PortOpen = True MSComm1.PortOpen = False List1.AddItem "COM" & CStr(intP)Next intP Exit Sub errSub:Debug.Print Err.Description End Sub ...