Hi, thanks for the response.
The arduino is on com3, and serialport=2 is the integer call for the com port it is the same as calling com3 because the integer call for the com port starts at 0, so 0=com1, 1=com2 and so on.
I read that on another forum. It suggested calling the comport as an integer to solve the error that I was having, so I tried it, but I am still getting the same error.