In Spain, software is protected by copyright. Spain’s Intellectual Property Act (TRLPI) (in Spanish) devotes its Title VII to computer programs: it protects them if they are original, in any form of expression, together with their preparatory design material and successive versions (Article 96), and reserves to the rightholder reproduction, transformation and distribution (Article 99). It does not protect the ideas and principles underlying them, including those underlying their interfaces.
Ownership is the key question. What a salaried employee creates in the course of their duties belongs to the company, unless otherwise agreed (Article 97(4)). In all other cases the rights belong to the author until they are assigned, and the assignment must be in writing and specify the rights, the modes of exploitation, the term and the territory: if it does not mention the term, it lasts five years, and if it does not mention the territory, it is limited to the country where it is signed (Articles 43 and 45). We explain this in our article on who owns the code and how it is assigned.
Two further laws complete the picture. Spain’s Patents Act (Law 24/2015) excludes computer programs as such (Article 4), but not technical inventions that incorporate them. And Spain’s Trade Secrets Act (Law 1/2019) protects technical information that has value because it is secret, provided its holder has taken reasonable steps to keep it secret (Article 1).
If your company is a startup, code ownership is one of the first things an investor checks: we cover it on our tech startup lawyer page. For the rest of your company’s intellectual property, such as trade marks, see our intellectual property legal services.