+ Reply to Thread
Results 1 to 3 of 3

Open Userform from custom ribbon

  1. #1
    Forum Contributor
    Join Date
    11-08-2017
    Location
    Murfreesboro, TN
    MS-Off Ver
    MS 365
    Posts
    168

    Open Userform from custom ribbon

    I have a custom ribbon with a button that I want to open a userform.

    I used the following code:
    Please Login or Register  to view this content.
    I get an error "Runtime Error 9, Subscript out of range". When I debug, it highlights the "UserForm1.Show" line above.

    If I remove the "control As IRibbonControl" and connect the sub to a button, it opens the userform as expected.

    Is there some reason why it would not work from the ribbon?

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

    Re: Open Userform from custom ribbon

    Is there any code in the Userform1 Initialize event?

    Is it possible to share example workbook that demonstrates the problem

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    11-08-2017
    Location
    Murfreesboro, TN
    MS-Off Ver
    MS 365
    Posts
    168

    Re: Open Userform from custom ribbon

    I went back in to make an up-loadable example and in doing that, got the button to work. Now the actual form is not working properly. I'm going to mark this string as solved and create a new one if I can't deconstruct the form and figure out what I did.

    Thanks for your reply!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Userform error in custom ribbon
    By taralmehta15 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2016, 05:39 AM
  2. Put VBA ribbon together with Custom UI Editor Ribbon
    By czarlando in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2016, 05:46 AM
  3. [SOLVED] An alternative to the Add-Ins ribbon tab - Global Custom Ribbon Tab by Ken Puls
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2014, 10:01 PM
  4. [SOLVED] Activate custom Ribbon Tab on Workbook Open
    By jewelsharma in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2014, 09:10 PM
  5. [SOLVED] Userform code fails when the userform is called from a custom ribbon button
    By klonbeck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 03:00 PM
  6. [SOLVED] Disable buttons in custom ribbon before opening a vbModeless UserForm
    By heapifyman in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 01-14-2013, 12:38 PM
  7. Replies: 5
    Last Post: 11-17-2010, 06:08 AM

Tags for this Thread

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