What will this do ?
What I will show you to do here is how to reset the sensors that tell the ECU where the sunroof is -whether it's open, closed or somewhere in between.
So lets get started
  1. Turn the key so the ignition is on
  2. Press and hold one side of the electric sunroof switch for 30 seconds
  3. Now press and hold the other side for 30 seconds
  4. Hey presto a working sunroof
If this does not work it is more than likely either the connections on the switch or the sunroof motor that is at fault.