Hi, thank you for contacting JustAnswer.com. My name is Russell. I will do my best to provide the right answer to your question.
If the lights still flash, the battery is not worn out. They might be low, but not out.
Do the lights flashing signify 'rejected code', or 'invalid code'?
Put your ear to the safe near the latch, and enter your code (if you can do this)... do you hear even a faint 'click'? if so, the latch is stuck, and try jiggling the handle, pressing inward on the door, then while pressing inward, they the code again.
What maker and model # ***** safe is it? how old is it? how frequently do you open it?