5m shouldn't be a problem for VGA, per se.
Can you try the cable on any other screens?
If you have previously had the laptop connected to the TV, I would suggest the new cable is dodgy, but you may need to prove this on more than one TV / PC to get your money back.