Sketch Upload Issue

Im trying to add some buttons for a racing simulator with a leonardo and no experience before. I have an issue where i try to upload the sketch after successfully verifying it but i get this error:

processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:160)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2030)
at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port 'COM4'.
at processing.app.Serial.touchForCDCReset(Serial.java:107)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:144)
... 5 more
Caused by: jssc.SerialPortException: Port name - COM4; Method name - openPort(); Exception type - Port busy.
at jssc.SerialPort.openPort(SerialPort.java:164)
at processing.app.Serial.touchForCDCReset(Serial.java:101)
... 6 more

i myself don't make much sense of it so if anybody knows whats going on that would be great cheers.

Make sure you have the correct port for your Leonardo selected from the Tools > Port menu.

If the Leonardo is doing serial communication with a program other than the Arduino IDE or Serial Monitor/Serial Plotter then you need to close that connection before uploading.

Try restarting your computer. Sometimes something will glitch out and cause this sort of upload error.

pert:
Make sure you have the correct port for your Leonardo selected from the Tools > Port menu.

If the Leonardo is doing serial communication with a program other than the Arduino IDE or Serial Monitor/Serial Plotter then you need to close that connection before uploading.

Try restarting your computer. Sometimes something will glitch out and cause this sort of upload error.

closed the connected program and worked like a beauty, thanks a heap

I'm glad to hear it. Enjoy!
Per