+ Reply to Thread
Results 1 to 2 of 2

fullscreen and custom toolbars in excel 2007?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    fullscreen and custom toolbars in excel 2007?

    The project I'm working on has a bit of code in the workbook open event that makes excel go full screen, hide any toolbars that a user has configured to run in fullscreen (and make a note so they can be restored on exit) and loads a custom toolbar.

    [code]

    Application.DisplayFullScreen = True
    Dim MyBar As CommandBar
    Dim MyPopup As CommandBarPopup
    Dim MyButton As CommandBarButton

    On Error Resume Next
    CommandBars("MAPS").Delete
    On Error GoTo 0

    Set MyBar = CommandBars.Add(Name:="MAPS", Position:=msoBarTop, temporary:=True)
    With MyBar
    Set MyButton = .Controls.Add(Type:=msoControlButton)
    With MyButton
    .Caption = "Exit"
    .Style = msoButtonCaption
    .OnAction = "Exit"
    End With
    .Visible = True
    End With

    [code]


    This works perfectly in excel 2003. However, in excel 2007 going full screen still leaves the windows control buttons at the top right of the window and no custom toolbar appears.

    Two questions:

    a) how do I make the code create a custom toolbar in excel 2007 and still be compatible with 2003?

    b) Is there a way to remove the windows controls from a fullscreened excel 2007 like 2003 is?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,935

    Re: fullscreen and custom toolbars in excel 2007?

    Excel 2007 and beyond provides a completely different model for controls called The Ribbon which is not accessible from VBA code the same way that toolbars are. Your code will not port to 2007.

    I believe there are methods available for customizing the ribbon but I haven't bothered with it. Here is one article on the topic.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1