I fixed this multiple times for a lady at work. What you need to do is the follwoing
1. climb in the car, put key in ignition
2. Close door and switch car on all the way to start but dont start the car
3. Now hold the sunroof button down, in other words press the button in upwards.
4. hold this down the whole time, after about 20 sec the sunroof will start moving, remember to keep hlding the button in.
5. Wait for the sunroof the completely open and close before letting go of the button.