• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Open Workbook In Full Screen........

JAMIR

Member
Hi,
I have workbook containing 10 Sheets. I want that, when i double click on the file, file should be open with desire sheet in full screen. [ Example: Sheet4 should be open in full screen ]

It is possible with VBA Code.

Regards,


ZAMEER SHAIKH
 
Copy the following into the ThisWorkbook Module in VBA

Code:
Private Sub Workbook_Open()
  ActiveWindow.WindowState = xlMaximized
  Application.WindowState = xlMaximized
  Application.DisplayFullScreen = True
  Sheets("Sheet4").Select
End Sub
 
Good Morning Hui Sir,

Thanks for your support. You guys are rocking.... I am so lucky.....
Thanks onces again..

Regards,

Zameer Shaikh.
 
Is this what you want !!!

Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
  ActiveWindow.WindowState = xlMaximized
  Application.WindowState = xlMaximized
  Application.DisplayFullScreen = True
End Sub
 

Attachments

  • SheetActiveCode.xlsm
    13.3 KB · Views: 52
You can also use something like that which checks the version of excel that the user is using...

Code:
Private Sub Workbook_Activate()

If Application.Version = "14.0" Then ' 2010

    On Error Resume Next
    With Application
       .DisplayFullScreen = True
        .CommandBars("Worksheet Menu Bar").Enabled = False
    End With

ElseIf Application.Version = "12.0" Then ' 2007

    On Error Resume Next
    With Application
       .DisplayFullScreen = True
        .CommandBars("Worksheet Menu Bar").Enabled = False
    End With

ElseIf Application.Version = "11.0" Then '2003
'This will disable all BuiltIn Command bars in 2003 version
    Dim Cbar As CommandBar
    For Each Cbar In Application.CommandBars
        If Cbar.BuiltIn = True Then
            Cbar.Enabled = False
        End If
     Application.DisplayFormulaBar = False
     Application.DisplayStatusBar = False
    Next

End If
End Sub
 
You can also use the below code. This will ensure that full screen is only applied to the intended workbook and all other workbooks (previously opened or new opened) is in normal mode. Hope this helps....

Code:
Private Sub Workbook_Open()

If Not (ThisWorkbook Is ActiveWorkbook) Then Exit Sub

ActiveWindow.WindowState = xlMaximized

  Application.WindowState = xlMaximized

  Application.DisplayFullScreen = True

  Application.CommandBars("Full Screen").Enabled = True

 

End Sub
 
Back
Top