The battery went in fob but I had spare battery so every thing was ok but what if I had not is there any way to enter the key works when just locked but not when alarmed
Are you talking about the built-in immobilizer or an aftermarket alarm system? If the immobilizer, use the key to unlock the door, then place the Toyota symbol on the fob against the power button for a few seconds - then press the power button to start the car. It's in the manual. If it's an aftermarket alarm system, all bets are off.
then it must be an aftermarket alarm, so i think you're out of luck. when you say it doesn't work, you mean the door opens, but the alarm goes off.