“…. And in His name you shall vow” (Devarim 10,20)
It is a positive commandment to vow in the name of Hashem at a time when it is necessary to fortify and to fulfil something or to distance it. About this it says “And in His name you shall vow” and just as an unnecessary vow is to be prevented and is forbidden with a negative commandment, so too a necessary vow is obligatory and is a positive commandment. Therefore, one may never swear by any of the creations and Chazal have said that one who joins the name of heaven to another entity is uprooted from the world.
Amongst the roots of the commandment, is that when we fulfill our word in His name, our belief in Him and His guidance over us and all our matters is strengthened in our hearts and this is extremely clear.
This commandment applies in every place and at every time, to men and to women. One who does not want to swear in His name in a time of necessity transgresses this commandment, but according to the Ramban this is not obligatory but optional ie. If we want to swear, we should swear in the name of Hashem but if we don’t ever want to swear, it does not matter at all. In his opinion it is also a commandment to refrain from vowing and only a person who has all the character traits enumerated at the beginning of the verse “You shall fear Hashem your G-d and it is Him you shall serve, and you shall cleave to Him” can fulfil the end of the verse “and in His name you shall vow”.