First of all you will need a new glovebox lock because its broken. That's why it won't open. Second, you will need a couple of long and narrow blade screwdrivers and 10 mm socket and/or wrench. You have to get down under the glovebox and find the three (3) nuts that hold the back hinge in place. They might be hidden under carpet and/or insulation but they are there! After you release them, the glovebox won't open but will move around some allowing you to reach with the screwdrivers and depress the "teeth" of the lock that engage in the dash metal bracket. Some people also remove the bolts that hold this bracket but I never did it this way. Watch out for the glovebox once it releases because is going down! Install your new (or used "new to you" latch), reattach the three nuts on the back (don't tighten them as you WILL need to move it around to get it to close prefectly again!) and adjust as required, tighten and enjoy!
Here is a write-up from another website:
"Take out the screws in the back of the box and let it hang down. then move to the front and remove the screws for the latch. i know what you mean you cannot get to the last one its impossible. so. what you do is keep wiggling the damn thing with some force, alot actually. you will start to bend the metal bracket which the lock goes threw and locks on to. once you do that after alot of pulling you will see the 2 teeth of the latch going threw the metal bracket. grab 2 small screw drivers push the in and ppull the glove box down. i just picked up my e28 yesterday and got the box open also did this with my e30.
hop this helps. ohh yeah also remove the bracket when you get it open and bend it back into place with a small hammer."