Consulting

Results 1 to 7 of 7

Thread: Solved: DisplayFullScreen Question

  1. #1

    Solved: DisplayFullScreen Question

    Hi,
    I'm using the following code to ensure only my toolbar is visable on any worksheet .

    Private Sub worksheet_activate()
    On Error Resume Next
    With Application
    .DisplayFullScreen = True
    .CommandBars("My toolbar").Enabled = True
    .CommandBars("Worksheet Menu Bar").Enabled = False
    End With
    On Error GoTo 0
    End Sub

    Works fine except the vertical scrollbar is visible and the horizontal is not.

    Ideally I need a way to keep both scrollbars, and even the worksheet tabs whilst having main menus/default toolbars hidden. I have been unable to find a properties element for fullscreen except for userforms.

    Can anyone help? I've searched for scrollbars and displayfullscreen but have not found an answer yet.

    Thanks

    Doug

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    How about

    [vba]

    Private Sub worksheet_activate()
    On Error Resume Next
    With Application
    .WindowState = xlMaximized
    .CommandBars("My toolbar").Enabled = True
    .CommandBars("Worksheet Menu Bar").Enabled = False
    End With
    On Error GoTo 0
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    Do you have the windows taskbar set to auto hide?
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    Interesting.

    If I use .WindowState = xlMaximized by itself, I still have the default toolbars (not wanted), but have the scroll bars and tabs(wanted).

    If I just use DisplayFullScreen = true and autohide the windows taskbar, it works.

    I also tried a combination of the both with either the windowstate before or after the displayfullscreen, with little joy.

    So if I hide the default toolbars (you know another questions coming don't you) then this would in theory provide the functionality I want, or force the users to change the windows taskbar to autohide (can this be done in Excel?).

    Any suggestions while I go and browse the objects?

    thanks

    Doug

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Dim oCB As CommandBar
    For Each oCB In Application.CommandBars
    oCB.Enabled = False
    Next oCB

    mFormulaBar = Application.DisplayFormulaBar
    Application.DisplayFormulaBar = False
    [/vba]

    and reset afterwards
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    I would go with the loop xld's given you - changing taskbar settings is one of those things (like changing a user's screen resolution) that I personally would find unacceptable.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    Thanks guys, that works better.
    I have a custom toolbar which should not be used on the first worksheet, so needed it disabling, and I also needed to remove clutter from the toolbar area to make mine more obvious and the entire workbook more user friendly.

    But I also need the scrollbars for the same reason.

    I am inclined to leave the menus there to prevent users calling be at all times of the day of night and just remove the toolbars now I have it working.

    Thanks
    again

    Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •