adjustment of sunroof
1-turn the ignition on
2-press and hold the sunroof switch until the sunroof closes and the motor is heard to stop turning.release switch
3-turn the sunroof switch to the tilt postion - the motor should set the sunroof to tilt position
4-press and hold the sunroof switch until the sunroof closes and the motor is heard to stop turning.release the switch
5-turn the switch to the fully open position - the motor should slide the sunroof to the fully open position
6-turn the switch to the closed position - the motor should slide the sunroof glass forward
7the preceding steps should allow the sunroof motor control electronics to learn the open,closed amd tilt positions of the sunroofglass.if at any time the adjustment procedure ,the sunroof glass opens un expectedly,repeat the steps in paragraghs 3-7 inclusive as necessary,until operation is satisfactory.
got from haynes manual

:ygood luck