Consulting

Results 1 to 9 of 9

Thread: Custom menu top left

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Custom menu top left

    Hi all.
    I have a custom menu that I call on loading and hide standard menus returning on closing workbook. The problem is I can not get my menu to position top left on opening it just floats in the middle. I have tried this code below but nothing. Any ideas please.

    Option Explicit
    
    Sub Make_ChartToolbar_Float()
        With Application.CommandBars("Wade")
            .Left = 10
            .Top = 200
            .Protection = msoBarNoProtection
            .Visible = True
            .Position = msoBarFloating
    
        End With
    End Sub

    Thanks

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    Have you tried docking it instead of floating it? (msoBarTop as Position)

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Top left of where?
    ____________________________________________
    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

  4. #4
    Yes tried that it still sits in the middle of the toolbar well

  5. #5
    Hi Xld Top left of the window (toolbar Well)

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Pixelpusher
    Hi Xld Top left of the window (toolbar Well)
    Sorry, which window? What is 'toolbar well'?
    ____________________________________________
    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

  7. #7
    Quote Originally Posted by xld
    Sorry, which window? What is 'toolbar well'?
    "Toolbar well" not sure the correct name but the area where toolbars snap into when dragged to top of screen or window.

  8. #8
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    Do you hide the standard menus before showing that one?

  9. #9
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try something like

    [vba]
    Sub Make_ChartToolbar_Float()
    With Application.CommandBars("Wade")
    .Left = 10
    .Top = 200
    .Protection = msoBarNoProtection
    .Position = msoBarTop
    .Left = Application.CommandBars("Formatting").Left _
    + Application.CommandBars("Formatting").Width
    .RowIndex = Application.CommandBars("Formatting").RowIndex
    .Visible = True
    End With
    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

Posting Permissions

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