You may be able to reinitialize your key, like member "kikiluv74" instructed earlier. You can watch a similar process on YouTube. Follow this link:
YouTube - BMW E39 changing the key battery - Part 2. I tried it and it worked about half way in both my '01 X-5 and my '02 325. Good luck!