I've owned 2 E36 verts and have diagnosed some problems. Tops can be tricky - there are a lot of micro switches, any one of which could go bad. There are also three motors and the processor which can give you trouble.
First, though, you should tackle the easy things - have you checked fuses? My Bentley manual says that for your '97, fuses 7, 24, 27, 42, 43, and 49 - in the black box on the left side of the engine compartment have some involvement with the top. Check them all. Mostly they are small amperage 5-10A; however 49 is a 20A.
Assuming the fuses are correct, probably your next step is to see if the motors operate under power. Probably this will require removal of the motors from the car. On my 96 - which was the semi-auto top, I found removal of the tonneau and top motors to be not too bad, just a little futzy. Your 97 should have a fully auto top which means a motor in the first bow. Since you first had trouble putting the top down, that might be the first suspect since none of the other motors will be called for until that motor has done its job. I now have a '98 which is the fully auto top, but it (knock on wood) has worked perfectly for the entire time I've owned it - so I've not had reason to take it apart. I did for some reason look it up online and it really didn't seem to bad of a job. Once out, you'll need a multi-tester and a power source to check for operation.
I've not heard (m)any instances of microswitches failing, short of physical damage, so if you get so far as finding the fuses are OK and the motors work it may be the processor and you might be best served going to the dealer for a diagnosis on that.
Good luck!