My dad has a vauxhall astra

any way he went to work in it today evrything was fine but when he got in it to come home he noticed the engine management light was on. it got him home no problem but when he went back to it to go shoping it wount start no spark so i went and got a new crank sensor and coil pack and it still in sparking it is a mk4 astra 1.6 8 valve s reg the car has only done 39k never has no bother with it till now any one can help i was thinking the chip in the key