I was trying to use a downloaded project from the Code Project to try and send/receive data from my old RS232 printer/console.
But I only get the run-time error 8015
Code listed below:-
Dim InputData As String
Private Sub Command1_Click()
Debug.Print DataToTransmitTextBox.Text
MSComm1.Output = DataToTransmitTextBox.Text
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
InputData = ""
DataToTransmitTextBox.Text = ""
ReceivedDataTextBox.Text = InputData
MSComm1.PortOpen = True <----- Error at this point
End Sub
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
ReceivedDataTextBox.Text = MSComm1.Input
Case comEvSend
Timer1.Enabled = True
Case comEvCTS
ReceivedDataTextBox.Text = InputData
InputData = ""
End Select
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
'All data sent, so toggle RTS
MSComm1.RTSEnable = Not MSComm1.RTSEnable
End Sub
I have set both ends up to use the following settings:- 300,n,8,1
Any suggestings?
But I only get the run-time error 8015
Code listed below:-
Dim InputData As String
Private Sub Command1_Click()
Debug.Print DataToTransmitTextBox.Text
MSComm1.Output = DataToTransmitTextBox.Text
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
InputData = ""
DataToTransmitTextBox.Text = ""
ReceivedDataTextBox.Text = InputData
MSComm1.PortOpen = True <----- Error at this point
End Sub
Private Sub MSComm1_OnComm()
Select Case MSComm1.CommEvent
Case comEvReceive
ReceivedDataTextBox.Text = MSComm1.Input
Case comEvSend
Timer1.Enabled = True
Case comEvCTS
ReceivedDataTextBox.Text = InputData
InputData = ""
End Select
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
'All data sent, so toggle RTS
MSComm1.RTSEnable = Not MSComm1.RTSEnable
End Sub
I have set both ends up to use the following settings:- 300,n,8,1
Any suggestings?