Initialization/Teach Procedure:
WARNING: This page is about a different car, the 2017 GMC Acadia. However, it is still accessible from the selected car via links, so may be relevant.
While the ignition is in the ON position and the glass panel is in full closed position, press and hold the forward switch for 10 secs (closed switch area). The glass panel will open to vent and go to full open and then closed position. Once the glass panel has closed then remove your hand from the switch.
NOTE:
Please note that if the switch is held for more than 10 seconds after the glass or sunshade has completed its teach/learn cycle, the sunroof can throw a 'stuck switch' fault code. If this happens repeat the 2 steps above.