To close the company you have to 'divest the company of its assets'. That means selling your house. Who are you going to sell it to ? Yourself ? But you are a foreigner and cannot legally own land ! You could set up another company and sell it to that !
Maybe it would be easier just to leave it as an asset of the company and declare no comercial activity ? Of course you can't do that if your visa is based on having a company !
Complicated innit ? Don't you wish you had bought in Spain ?