R
rl_goebel
I have a problem with excel 03 giving me a run-time error '424' from runing a
macro.
the macro is design to get infromation for a gage connect to the computer
using com port
here is the code
Private Sub UserForm_Activate()
Dim ClearBuffer As String
' Clear the data in the plasticity curve data worksheet
Sheets("Plasticity Curve Data").Select
Range("rdgTime").Select
Selection.ClearContents
Range("PMeasurement").Select
Selection.ClearContents
Range("A2").Select
'configure the serial port
MSComm1.CommPort = 3 ' Use COM2.
MSComm1.Settings = "2400,N,8,1" ' 9600 baud, no parity, 8 data, and
1 stop bit.
MSComm1.InputLen = 0 ' Tell the control to read entire
buffer when Input is used.
MSComm1.RThreshold = 13 ' Activate Event Handler and send
event after xx No. Characters
MSComm1.PortOpen = True ' Open the port.
ClearBuffer = MSComm1.Input ' Clear the Serial Port buffer for
data capture
SetupMitutoyo 'Configure The Mitutoyo for distance
Measurement
' Configure Plasticity Measurement form
TextBox1.Text = ""
TextBox3.Text = ""
UserForm1.Top = 90
UserForm1.Left = 255
CommandButton1.Caption = "Start"
CommandButton1.SetFocus
End Sub
VBA's debug is highlighting MSComm1.CommPort = 3 ' Use COM2.
but, the gage is sending data , excel is not taking it.
macro.
the macro is design to get infromation for a gage connect to the computer
using com port
here is the code
Private Sub UserForm_Activate()
Dim ClearBuffer As String
' Clear the data in the plasticity curve data worksheet
Sheets("Plasticity Curve Data").Select
Range("rdgTime").Select
Selection.ClearContents
Range("PMeasurement").Select
Selection.ClearContents
Range("A2").Select
'configure the serial port
MSComm1.CommPort = 3 ' Use COM2.
MSComm1.Settings = "2400,N,8,1" ' 9600 baud, no parity, 8 data, and
1 stop bit.
MSComm1.InputLen = 0 ' Tell the control to read entire
buffer when Input is used.
MSComm1.RThreshold = 13 ' Activate Event Handler and send
event after xx No. Characters
MSComm1.PortOpen = True ' Open the port.
ClearBuffer = MSComm1.Input ' Clear the Serial Port buffer for
data capture
SetupMitutoyo 'Configure The Mitutoyo for distance
Measurement
' Configure Plasticity Measurement form
TextBox1.Text = ""
TextBox3.Text = ""
UserForm1.Top = 90
UserForm1.Left = 255
CommandButton1.Caption = "Start"
CommandButton1.SetFocus
End Sub
VBA's debug is highlighting MSComm1.CommPort = 3 ' Use COM2.
but, the gage is sending data , excel is not taking it.