problem with visualbasic 2010 coding

My advice was about the errors in the piece of code you posted. Presumably that exception comes from another part of the code. Without seeing the full code, it's hard to tell.

Also, does it happen just by clicking that Button1 or when some serial data comes in ?