The electromagnetic linear momentum and the energy balance in an infinite solenoid with a time-dependant current are examined. We show that the electromagnetic linear momentum density and its associated force density are balanced by the hidden momentum density and its associated hidden force density respectively. We also show that exactly half the energy delivered by the power supply appears as stored magnetic energy inside the solenoid. The other half is lost against the induced electromotive force that appears in the windings of the solenoid during the time through which the current is building up towards its final value. This energy loss, which is found in other analogue situations, is necessary to transfer the system from an initial non-equilibrium state to a final equilibrium one.