On re-reading this thread, I'm not surprised that the OP can't get a visa sticker locally. If you're inside a country already there would be no need to grant permission to enter, at least, I thought this was generally the case in EU countries.
Unless the OP is on a short course, he should have a Spanish residency permit (Tarjeta de Identidad de Extranjero) which may be the way forward here.