In this case, the purpose of the loan is to invest in shares. The original loan was to buy shares, not to fund living expenses.
Could the fact that you are using dividends for living expenses make the interest not tax deductible?
Or are you saying that, the next year, interest on the debt...