Do you mean you did not unplug the pc from the mains when taking out the battery?
Turn off the pc.
Unplug it from the mains.
Leave it for a few minutes.
Remove the battery.
After 30 minutes replace the battery.
Switch the pc back on.
If it's still there after that the Password could be stored on an eprom which is a similar thing to some laptops and cannot be erased except by specialised means.