OK, no answers this far. Either nobody knows or nobody cares :?
I´m asking because I´m going to spend a weekend in Barcelona before my Camino and have not yet decided if I´m going from Montserrat or from Pamplona/ Roncesvalles. They sell pilgrims pass in Barcelona and beeing a beginner I don´t know if it is valid all over Spain or if I must wait till I get to Pamplona.
assuming you mean the credencial, non-Spaniards normally get one from their local Jacobean association, in your case in Sweden, or when they cross into Spain, e.g. at Roncesvalles. There is normally no charge for this. If you're not doing either of these, you can get one from the Amics in Barcelona http://www.amicsdelspelegrins.org/ipresentacio.htm
There's an online form, or, probably better if you're in Barcelona, go round to their office. They might ask you to become a member or give a donation before they'll give you one. Either way, these are/should be valid at all albergues anywhere in Spain (or at pilgrim hostels in other countries). AIUI, discussions are under way for creating a standardised credencial throughout Europe.