Forum Discussion
Serial COM Ports in Excel VBA
Hi,
Thanks for creating this library! I’m running into a problem when reconnecting an Arduino device.
I can successfully open the COM port from VBA, send a command to the Arduino, and receive the expected acknowledge. So the initial communication works perfectly.
However, when I unplug the Arduino’s USB cable and plug it back in, the behavior changes. VBA can still send data to the Arduino, but the Arduino can no longer send anything back to VBA. My assumption is that the STOP_COM_PORT function does not fully close and release the COM port handle, so after reconnecting the USB device, VBA is still holding on to an old/invalid port instance.
Could you advise how to properly and fully close the COM port so that communication works again after unplugging and reconnecting the Arduino?
Thanks in advance!
- MatthimasterApr 16, 2026Occasional Reader
Hi,
I fixxed the issue!
It had nothing to do with the COM port handle, but with my arduino that had some issues with the restart. Now the vba code sends a DTR and RTS code through the SIGNAL_COM_PORT function so the arduino resets and starts working properly again.