take the key and hold it right up to the sensor (top front windshield) and make sure it really and truly doesn't work. they tend to lose range in very bright sunlight.
If it really doesn't work, read this post and follow the intructions:
http://www.bimmer.info/forum/showthr...ht=key+program