I am trying to create some sort of error catching method that will return the error line number. We have an abort email that is sent out when a process aborts that gives us the
You can use the StackTrace to retrieve the line number on an error.
Try
'Put your code here
Catch ex As Exception
Dim trace = New Diagnostics.StackTrace(ex, True)
Dim line As String = Right(trace.ToString, 5)
MessageBox.Show("'" & ex.Message & "'" & " Error in- Line number: " & line)
End Try