For some reason Excel 2016 switches to a different workbook when I run a macro. There is no code that indicates this is happening. I've tried to switch the focus back using
Appworkbook.Activate
but it only works if I put a breakpoint there. I've tried sleep as well. It works fine on Excel 2010 and the macro does what it is supposed to do.
Has anyone experienced similar?
*****SOLUTION (Not ideal!)*****
I ended up fixing this issue but adding a new button and calling the macro from a button_click method. I have no idea wy that worked and assigning the macro to the button didn't.