Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not working: ActiveWindow.WindowState = xlMaximized 2

Status
Not open for further replies.

Abi1

Technical User
Jul 4, 2001
19
GB
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
Application.WindowState = xlNormal
ActiveWindow.WindowState = xlMaximized

THIS CODE WORKS
;)
ANDREW299
 
Yes, it works now.

Thanks Andrew299!
 
Does this go into a module or into the "this workbook" selection?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top