Workaround for issue when running a macro from the toolbar with the main window on the foreground.