The phrase 'in vain' can mean futile, without effect or to no avail:
A captive to my galling chain,
I've tried to rise, but tried in vain...

  Save The Boys by Frances E. W. Harper

To do something 'in vain' can also mean to act sacrilegiously -- using the Judeo-Christian God's name in vain is blasphemous and goes against the Ten Commandments1
Thou shalt not take the name of the LORD thy God in vain; for the LORD will not hold him guiltless that taketh his name in vain.   Exodus 20:7, King James Version

1 Frater 219 says that 'taking the Lord's name in vain' means using the name of God to swear to a false statement.