I've got an on-open macro in my Excel workbook which is supposed to maximise Excel and maximise the workbook within Excel. Should be simple enough. My code is:
Application.WindowState = xlMaximized
ActiveWindow.WindowState = xlMaximized
Excel maximises itself ok, but the workbook doesn't. Running the code in debug mode works and the workbook gets maximised. Running it for real when the workbook opens just leaves the window at about a quarter of the size, but doesn't produce any errors.
Any idea what's going on?
Application.WindowState = xlMaximized
ActiveWindow.WindowState = xlMaximized
Excel maximises itself ok, but the workbook doesn't. Running the code in debug mode works and the workbook gets maximised. Running it for real when the workbook opens just leaves the window at about a quarter of the size, but doesn't produce any errors.
Any idea what's going on?