These instructions apply to the Vauxhall Astra Mk7 (K/B16) 2015-2021.
For other models, please choose your vehicle here.
If the sliding sunroof on your Vauxhall Astra K (Mk7, 2015–2021) — sold in many markets as the Opel Astra — stops auto-closing, refuses to tilt cleanly, or starts behaving oddly after a flat or disconnected battery, it almost certainly needs re-initialising. This is a normal recalibration, not a fault or a broken motor. The roof control unit has simply forgotten the exact positions it learned for fully open, tilted and fully closed, and it needs to be walked through the range once so it can relearn them. On the Astra K that re-teach is done entirely from the driver’s seat using the roof switch, and it takes under a minute.

Why It Happens
The sunroof controller stores its open, tilt and closed limits so it can run on a single touch and auto-reverse the moment it senses an obstruction. Those stored limits are what make one-touch operation and the anti-trap safety feature work. When power is cut — a flat battery, a battery disconnect for other work, or a jump-start gone wrong — that memory is wiped. Until it is re-taught, the roof may creep instead of running fully, refuse the one-touch function, or stop part-way. Re-initialising restores all of it. Nothing has actually broken; the controller has just lost its reference points and needs to see the full travel once more.
First, a Few Checks
- Make sure the 12 V battery is healthy and, ideally, do this with the car recently run so voltage is strong — a weak battery can interrupt the learn cycle.
- Switch the ignition on (engine can be running or not) so the roof has full power for the whole cycle.
- Check the roof track is clear of leaves, grit or ice that could stall the panel mid-travel.
- Keep hands, hair and objects clear of the roof opening throughout — the panel moves under its own power during the learn.
- Do it parked, not while driving, so you can hold the switch steadily.
How to Re-initialise the Sunroof
- Switch the ignition on.
- Make sure the sunroof and sunshade are closed.
- Press and hold the close switch (push it to the ‘close’/tilt-up position). The roof will move slightly — keep holding.
- The roof then runs through its full close cycle automatically; keep the switch held until it finishes.
- Release — the system is reset and one-touch works again.
If It Doesn’t Complete
- Don’t release the switch early. This is the mistake that catches most people — you must hold it through the entire cycle, including the small initial movement, until the panel has finished on its own.
- Clear any obstruction in the roof track or seal, then try again from the start; a snag can cancel the learn.
- Rule out a weak battery. Low voltage can drop the roof out of its learn routine part-way; charge or run the car and repeat.
- If the panel only tilts and won’t slide, or won’t move at all, close it fully first — the routine expects to begin from the closed position.
- Repeat the whole sequence once or twice if the first attempt didn’t take; it is safe to do again.
What to Expect Afterwards
Once the cycle completes and you release the switch, one-touch open and close should return, and the auto-reverse anti-trap safety should work again. It is worth cycling the roof fully open and fully closed once to confirm it runs smoothly end to end. If it still hesitates after a clean re-initialise, the issue is more likely mechanical — a dry or dirty track, a tired motor, or a drainage/seal problem — rather than lost calibration.
Frequently Asked Questions
Why did my Astra sunroof stop auto-closing?
A battery disconnect or a flat battery wiped the controller’s learned open, tilt and closed limits. Without them the one-touch and auto-reverse functions won’t run properly. Re-initialising by holding the close switch through a full cycle re-teaches those positions and restores normal operation.
How do I reset the Vauxhall Astra sunroof?
With the ignition on and the roof and sunshade closed, press and hold the close switch. The panel makes a small move, then runs through its full close cycle automatically — keep the switch held the whole time. Release once it finishes and one-touch is restored.
Is it safe to do myself?
Yes. There is no tool, no trim removal and no electrical risk involved. The only thing to watch is the roof opening itself — keep hands, hair and objects clear while the panel moves under power during the learn cycle.
Do I need a tool or a dealer?
Neither. The whole procedure is done with the sunroof switch from the driver’s seat. You don’t need a scan tool or a workshop visit for a straightforward re-initialise after a battery event.
The roof only moves a little and stops — what am I doing wrong?
Almost always you are releasing the switch too soon. That first small movement is the start of the routine, not the end. Keep the switch firmly held until the panel has completed its full close cycle on its own, then let go.
Do I need to redo this every time I disconnect the battery?
Yes, if the sunroof loses its calibration again. Any full loss of 12 V power — a battery change, a long disconnect, or a deep flat battery — can wipe the learned limits, so re-run the same one-touch re-initialise afterwards if the roof starts behaving oddly.
Re-initialised the sunroof after a battery change? Re-teach the windows too — see our Astra K window guide. For any warning light that appeared, look up the code on autodtcs.com.
Independent guide — not affiliated with Vauxhall. Always follow your official service manual and safety precautions. Read our full disclaimer.