• Force maximized (Office 2007)

    Author
    Topic
    #456607

    Since Excel 2007 usually defaults in the user’s window to whatever window state they last had (minimized, maximized, half screen) — is there a way to write VBA code into an Excel spreadsheet that would force it to open maximized (both program window and file window) each time it opens, regardless of the last window state used by Excel by that user?

    Viewing 0 reply threads
    Author
    Replies
    • #1141574

      I assume that you want the Excel window to be maximized (i.e. fill the entire screen).

      Press Alt+F11 to activate the Visual Basic Editor.
      Double-click the ThisWorkbook item for the relevant workbook in the project explorer on the left hand side of the Visual Basic Editor.
      Enter or copy the following code into the module that appears.

      Private Sub Workbook_Open()
      Application.WindowState = xlMaximized
      End Sub

      Users will have to trust/enable macros in the workbook, otherwise the code won’t run.

      • #1141585

        Thank you, Hans! We will test this.

        Macros are already trusted/enabled, as well as links, as this is an Excel file linked from our Sharepoint site, for internal users. Group policy already has those trust settings like that, due to other things in the worksheet.

        Thanks again so much

    Viewing 0 reply threads
    Reply To: Force maximized (Office 2007)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: