Do you have a copy of your prescription, or access to your GP medical records online? I can’t imagine any pharmacy or dr giving insulin without any proof of it being prescribed previously. I don’t know the Spanish system, you may have to see a Dr first for a prescription.
Having a bit of a google I’ve found this travel guide but nothing about getting a prescription or buying insulin, but does talk about different insulin syringe types over there.
https://www.diabetes.co.uk/travel-guides/spain.html
And this taken from a travel insurance site.
1. Call someone for help
Travelers who discover their prescription medications are lost or stolen should start by contacting the assistance service company provided in their travel insurance policy. The travel insurance assistance services is the simplest way to get your prescriptions replaced as the service representatives will be able to make the calls to your doctors and pharmacies back home and then advise you how to proceed.
Even with a prescription and cash in hand you could have trouble
Even if you’re prepared with a copy of your prescription and the money to pay for the drugs, many countries do not permit pharmacies to fill prescriptions that originate outside their country. One solution is to see a local doctor to explain your medical condition to get a new prescription that can be filled locally. If you have a letter from your doctor back home explaining your condition and the medication used to treat it, that will help the local doctor.
https://www.travelinsurancereview.n...vel-safety-tips/replace-prescriptions-abroad/