2007 Impala keyless remote only works sometimes

We have a 2007 Impala that had the keyless remote that stop working. We assumed it was the battery and replaced it. Now the remote won’t work until we open the car with the key. We now key into the car to unlock it and After it unlocks and is open with the key, it will lock and unlock with the remote again. (proving that the battery does work) . Is there something we need to know about reprograming the remote? Any suggestions would help.

Your owners manual has a section as to how to reprogram the remote as well as how to reprogram the power door locking modes.