Sunroof switch seem to be posessed? Opens by itself? This how-to will give you tips on how to clean and adjust the contacts within the switch and put a stop to that madness. This only applies to cars with the 2 way rotary switch.
Step one is to pull down the lens for the interior light, and map lights. Just grab it at the edge, and gently pull down.
Remove the 2 screws, and pull the switch unit down starting at the edge closest to the windshield. There are 2 metal clips you can work with your fingers that hold it up in the headliner.
Once you get the switch down, disconnect the harnesses for the lights and the switch itself. Flip the unit over, and gently pry the bottom of the switch off. Nothing will fly out.
Once you get the switch open, you can gently clean the contacts with some alcohol.
You might also try to gently bend the metal contacts up a little, so they contact the circut board side a little better. I think that this is the real problem, the metal fingers lose contact with the bottom part of the switch.
Ever since I did this procedure on my switch, it has not opened by itself once. I hope it works for you!!!