The cable connects to the mechanical parts that cause all the motion. The sunroof that pops up and retracts is much more complex than the ones that only retract. Your problem lies in this mechanism, and possibly the cable connection to the mechanism.
I have never had to work on the ones that pop up and retract, so I am not able to offer first hand perspective, but others have and their cases should show up on a search for threads on sunroof failures. In my case the cable connection to the mechanism partially broke, and allowed some extra degrees of freedom in the cable motion. This caused the cable to be unable to drag the connector back into the cable guide tube slot (misalignment) and the roof would neither drop down nor retract. Cost was under a dollar for the genuine MB part to fix it.
To gain any perspective on what is happening and what should be happening you have to take the liner off the sliding panel of the sunroof, and look. If the roof will not open at all, you are going to have to remove the front edge of the liner by prying with a spatula like tool, or a knife. It is held in place by some spring clips that snap into holes in the sheet metal structure of the moving roof panel front edge. Once it is loose you have to carefully bow it to pull the sides clear of the shelf on either side that supports the liner along each side of the sliding roof panel. Once it is out, you can see the connection.
Putting the liner back on is done best after you have the roof open part way, and then loaded in though the roof opening from the top. Much easier, and, if you can get the roof to open before you take the liner out, it goes out through the openning and out the top much easier (no bowing required). Hope this helps, Jim
1986 Euro 190E 2.3-16 (291,000 miles),
1998 E300D TurboDiesel, 231,000 miles -purchased with 45,000,
1988 300E 5-speed 252,000 miles,
1983 240D 4-speed, purchased w/136,000, now with 222,000 miles.
2009 ML320CDI Bluetec, 89,000 miles
1971 220D (250,000 miles plus, sold to father-in-law),
1975 240D (245,000 miles - died of body rot),
1991 350SD (176,560 miles, weakest Benz I have owned),
1999 C230 Sport (45,400 miles),
1982 240D (321,000 miles, put to sleep)