gas cap loose is turning on service engine light soon on on 2005 Buick LeSabre

Will a new gas cap turn off service engine light soon off if a new gas cap is the solution?

Get Your Car Fixed at a RepairPal Certified Shop.
We certify shops based on expertise, quality work, and verified customer reviews
2 answers
have codes scanned at auto zone and post so we can adv
A new cap will not turn the light off IF indeed it was actually the problem. But a scanner will and while hooked up scan codes as suggested.