Comm32 Logo
Home Button  Buy Button 

Topic:   Invalid port number

By: ChrisPosted on: Jul 15 2021 at 06:58:45 AM
I am running VBA in Access

When I click on a button and execute the following simple code I just get Run-time error 8002 Invalid port number.

SComm1.CommPort = 1
SComm1.Settings = "9600,n,8,1"
SComm1.PortOpen = True
SComm1.Output = "Hello World"

I expected to see "Hello World" appear on Tera Term.

By: SupportPosted on: Jul 29 2021 at 04:15:54 AM
Run the code in the IDE and single step. I assume you're getting the runtime error at .PortOpen

Are you sure your port is Com1?

Look in Windows Device Manager. This lists all device in your computer. There should be a group named "Ports Com&LPT". Do you see that? Inside there you should have the available com port numbers. Do you have a Com1 ? (or some other Com number)

Reply - add a comment to this topic.

You may enter letters, numbers and standard punctuation only. HTML and other scripts/tags will be rejected.

Topic:- Invalid port number

Enter the numbers.

Your name here is optional