Make sure the USB cable is completely plugged into both the Arduino board and the PC.
The USB cable not being fully inserted into the USB socket can result in the power connections being made (and thus LEDs lit on the board), but no data connections (and thus no port for the board).
Try to blow away the dust in USB socket of mega. Did you check if the code is getting uploaded by manually selecting the board and port? If that works no need to worry right.