Memory Reset Procedure
WARNING: This page is about a different car, the 2004 Nissan Quest. However, it is still accessible from the selected car via links, so may be relevant.
If the battery is disconnected, or the sunroof motor harness connector is disconnected, the slide switch will become inoperable and the sunroof motor memory must be reset. To reset the sunroof motor memory from any sunroof position (full open, partially open, closed, partially vented, and vented), push and hold the sunroof tilt switch in the tilt down position until the unit is closed. Push the switch once in the tilt down position. Finally, push the switch in the tilt down position for 2 seconds. This resets the sunroof motor memory and now the sunroof will operate correctly.