+ Reply to Thread
Results 1 to 10 of 10

Menu bars

  1. #1
    Registered User
    Join Date
    03-20-2009
    Location
    Lithuania
    MS-Off Ver
    Excel 2013
    Posts
    99

    Menu bars

    Hi,

    I'm using Excel 2007 and as you probably know my own created menu appears under add-in tab in this excel version. I'm wondering is it possible to make that when excel workbook is opened, add-in tab would be automatically selected and users could see those created menus?
    Last edited by walduxas; 01-18-2012 at 07:22 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Menu bars

    Good afternoon walduxas

    This method is a bit flaky as it uses SendKeys, which isn't amongst the most reliable of VBA commands, but
    Please Login or Register  to view this content.
    should do the trick for you.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Menu bars

    You can use Tony Jollan's approach of using the Accessiblilty interface
    http://www.wordarticles.com/Shorts/R...bonVBADemo.php
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Menu bars

    Hi,
    If you need a more reliable method than SendKeys, then Tony Jollans has some excellent code here showing how to control the Ribbon using Accessibility.
    Good luck.

  5. #5
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Menu bars

    Now there is a coincidence!

  6. #6
    Registered User
    Join Date
    03-20-2009
    Location
    Lithuania
    MS-Off Ver
    Excel 2013
    Posts
    99

    Re: Menu bars

    Hi again,

    It looks like the code, suggested by OnErrorGoto0, works in Word application, but it seems that it's not working in Excel. In Excel I receive error message "Runtime error 91 - Object variable or with block variable not set". Does anyone know where's the issue?

    I pasted this code in ThisWorkbook (underlined is the statement where I get error message:
    Please Login or Register  to view this content.

    I pasted this code in Module1 :
    Please Login or Register  to view this content.

  7. #7
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Menu bars

    Change that line to
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-20-2009
    Location
    Lithuania
    MS-Off Ver
    Excel 2013
    Posts
    99

    Re: Menu bars

    I wonder why I didn't think of that anyway, thank's OnErrorGoto0

  9. #9
    Registered User
    Join Date
    01-30-2012
    Location
    iowa
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Menu bars

    I was able to make this work on all the tabs except for the "Add-Ins" and this is the one I'm wanting to display. Is there something I have to do special for the "-" in 'Add-Ins'?

    Thanks.

    Phil

  10. #10
    Registered User
    Join Date
    03-20-2009
    Location
    Lithuania
    MS-Off Ver
    Excel 2013
    Posts
    99

    Re: Menu bars

    Hi, philipb645,

    maybe you could try to use function
    Please Login or Register  to view this content.
    to check if the name of the tab contains symbol "-" or text "Add" and if it's true, then you can indicate to open this tab.

    Kind regards

+ 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