Rectangle 27 0

inputbox Conversion from string "" to type 'Integer' is not valid. VB.NET?

I presume lineNo is declared as Integer? Clicking "Cancel" on the InputBox will return an empty string, and an emptry string cannot be converted to a numeric value. That's what your error says. So you should get the result of the InputBox, which always returns a String, and convert it in a separate step, maybe with Integer.TryParse.