Arduino Mega2560 can't be programmed via USB

Can you post the sketch that you are trying to upload?

Make sure you don't have three or more exclamations points in a row "!!!", the bootloader will interpret that as an escape sequence and enter a special mode.