A couple of things to try:
1. Turn ignition on, but don’t start car. Check operation of all of the windows is ok up and down. Sometimes if they haven’t been opened or closed for a while, they don’t move freely which can knock out the calibration on the window upper/lower stops. If all working ok, for each window in turn, lower using the button, but keep the button depressed after it reaches its lowest point (approximately 5 seconds, until you hear a click), then raise the window, but keep the switch held up when fully closed (again for approximately 5 seconds until you hear a click). This procedure recalibrates the windows - not too sure about the sunroof, but would expect it to be the same procedure. Once you have done this, it should work if selected.
2. Does the battery in the key fob need replacing or has it been replaced? If low battery, you usually get a warning on the dash. If battery has been replaced then there is a procedure post fitment of the battery. I will find the link that I posted before with
how to do this.