If the deceased was resident in Flanders, you must file an estate declaration for Flanders. You will then basically pay Flemish inheritance tax on the deceased's worldwide estate. Since you live in Spain, you are also required to file an estate declaration for Spain. You will then pay Spanish inheritance tax in accordance with the rules of the region in which you live on the entire inheritance you receive.
If the deceased was resident in the Netherlands, you must file an estate declaration in the Netherlands. Since you live in Spain, you are also required to file an estate declaration for Spain. You will then pay Spanish inheritance tax in accordance with the rules of the region where you live on the entire inheritance you receive.
If the deceased was resident in Spain and you also live in Spain, you file an inheritance tax return in Spain and pay inheritance tax in accordance with the regional rules of your place of residence. If you inherit property in Flanders, there is also a right of transition. If you inherit from a Dutch citizen, the rules depend on how long the deceased lived outside the Netherlands.
Here you can find more information on the estate declaration in Flanders, estate declaration in Spain and the Dutch inheritance tax on Spanish property.