Formulation via vector potentials of eddy-current problems with voltage or current excitation