+ Reply to Thread
Results 1 to 3 of 3

Userform code fails when the userform is called from a custom ribbon button

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    Lebanon, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    47

    Userform code fails when the userform is called from a custom ribbon button

    I am not sure how to fix this problem, or even why it is a problem. I created a userform that will list the folders, sub-folders and files in a user selected directory. The user is then able to select the desired items from the list and move them into a "waiting cue" that will copy the items to a user defind destination. Right now I have this userform in a workbook that the user has to referance, and the userform is called from a button located in sheet1. In this format the userform works great.

    What I would like to do is call the userform from a custom ribbon button. I have made the userform into an addin and created a custom ribbon tab with a button that calls the userform. when I click the button the userform loads but when the user attempts browse for the source files I get this error: Compile error: User-defined type not defined. I dont understand why the code fails when called from the ribbon but it works when called from a button in the spreadsheet.

    I have attached spreadsheet version and the ribbon version for reference.

    Thank you very much for the help.

    Vendor Info Report.xlsm, Ribbon.zip

  2. #2
    Registered User
    Join Date
    11-14-2012
    Location
    Lebanon, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Userform code fails when the userform is called from a custom ribbon button

    Does anyone have any ideas on how to fix this problem?
    Thank you for the help.

  3. #3
    Registered User
    Join Date
    11-14-2012
    Location
    Lebanon, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Userform code fails when the userform is called from a custom ribbon button

    I found out what was wrong! It turns out that all I needed to do was go into the VBAProject References and select Microsoft Scripting Runtime. References is located under Tools in the VBA Window.

+ 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. [SOLVED] UserForm Toggle Button Code
    By JasonRay in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-08-2013, 05:29 PM
  2. [SOLVED] Userform called from another userform textbox - unload problem
    By barryleajo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-27-2013, 01:09 PM
  3. [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
  4. macro fails to function correctly when called from button form control
    By sarails in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2011, 01:39 AM
  5. [SOLVED] Looping procedure calls userform; how to exit loop (via userform button)?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2005, 08:05 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