IDE2 might fail detecting the port change during the upload · Issue #2203 · arduino/arduino-ide · GitHub
![COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center](https://support.arduino.cc/hc/article_attachments/360016532020/COM_port_changes_0.png)
COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center
![Can't open device "\\.\COM4": Access is denied error when uploading a sketch from Arduino IDE | I learned it. I share it. Can't open device "\\.\COM4": Access is denied error when uploading a sketch from Arduino IDE | I learned it. I share it.](https://gyorgybalassy.files.wordpress.com/2020/10/arduino-port-selection.png)
Can't open device "\\.\COM4": Access is denied error when uploading a sketch from Arduino IDE | I learned it. I share it.
![COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center](https://support.arduino.cc/hc/article_attachments/360016532060/COM_port_changes_4.png)
COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center
Initially my Arduino port was detected and I was able to upload the sketch but the next day it couldn't or no port was detected even though it was connected to USB,
![COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center COM port number changes when connecting board on different ports or in bootloader mode – Arduino Help Center](https://support.arduino.cc/hc/article_attachments/360016532000/COM_port_changes_2.png)