Trouble uploading sketches to Arduino UNO

Have you tried disconnecting everything and only connect the Uno using the USB cable?

You will probably have to provide details as to what you have/had connected and how. And probably nobody knows which code you're talking about; post it here using code tags ([code] and [/code]).