I am trying to remove the spindle to replace the lock on my upvc window, but the spindle is jammed. I have tried wd40 and leverage but it won't budge. What else can be done?
Is it a standard 'ESPAG' [square shaft] type?
It's not really leverage you need, it's a shock. Once the window mechanism is free to turn, then the hardware stop inside the handle itself will prevent any further leverage against the actual window mechanism… which is what you need. You're then just pushing self against self, not touching the spindle/socket interface, where it's stuck.
If the spindle has started to turn too far inside the locking mechanism, due to rounding, then a tap with a [soft or wooden] hammer should free it up - so long as you tap it the right way. As you can't see until you've cleared it which way that should be, just be careful; tap one way, then flip the handle & tap it the other. It ought to come free fairly easily.
The chances are it will be over-tightened in the same way as closing the window, rather than opening it. The stop in the handle mechanism only really works when opening, it doesn't come into play as much when closing. That gives you the opportunity to close the window [make sure not to let it lock] then tap the handle towards 'open'. You're not trying to actually open it this way, just free it up opposite to the normal way the most pressure is usually exerted.
If it's still fighting you, then you might need to set up some clamp mechanism to hold the actual window hardware still, whilst you shock the interface between the two. How you achieve this will depend on the exact window mechanism, which is less ubiquitous than the handle interface.
Just note you can't 'shock' it if you're working against the handle itself against either stop, open or closed. You have to work at an angle the stop isn't hampering your tap.