+ Reply to Thread
Results 1 to 16 of 16

Show an msoImage in a Userform (Excel 2010)

  1. #1
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Lightbulb Show an msoImage in a Userform (Excel 2010)

    Hi,
    I was wondering if anyone has an idea (if it is possible) to show the image of a ribbon button in a Userform.
    Let me explain. When you create a custom ribbon you place the msoimagefilename in the button and the corresponding image is shown in the button

    The name '_50PercentComplete' (see ittached image, it's the 5th from the top left)

    The idea is to show a dropdownlist in a userform and when one is selected, show the corresponding bitmap.

    I hope I've been able to explain myself
    Attached Images Attached Images
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Show an msoImage in a Userform (Excel 2010)

    i'm not sure if I perfectly understand the question but you could use some image object in your userform and loadimage code in the combobox change event:

    Please Login or Register  to view this content.
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Re: Show an msoImage in a Userform (Excel 2010)

    Hi Bilina2k,
    Maybe I was not able to explain myself correctly, if the image is present on any disk, then that would not be an issue, but thse images are not presnt anywhere except when you adress them in the Ribbon.
    There are many ways to get the nmase of these corresponding images but not the image themselves
    I attached page 2 of a 14 page pdf file wher you can see the name of the image and the image on the right.
    For example: imageMso="FileManageMenu"
    I can then then copy and paste this in the corresponding ribbon button and I will see that button, but when I customize the ribbon I would like to know what the image looks like if I only have the name

    I hope this explains it a little Thanks for taking the time.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Show an msoImage in a Userform (Excel 2010)

    Maybe this could help? https://imagemso.codeplex.com/

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Re: Show an msoImage in a Userform (Excel 2010)

    Thank you, I had seen this one some time ago but had some issues when loading.
    It loaded now, I've exported the ico files and will see if I can use this.
    Will let you know.
    Thanks again

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Re: Show an msoImage in a Userform (Excel 2010)

    @bulina2k: I exported the ones I wanted as bmp and that works fine now, Ijust made a selection and am implementing it my custom UI code so that the user can select the image shown in the Ribbon on-the-fly, something like Ribbon Commander but made easier and multi language
    Thanks for the help and tips

  7. #7
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Show an msoImage in a Userform (Excel 2010)

    I'm glad I could help!

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

    Re: Show an msoImage in a Userform (Excel 2010)

    you can display msoImages using

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Thumbs up Re: Show an msoImage in a Userform (Excel 2010)

    Hi Andy,
    I get the following error:
    Run-time error '5':
    Invalid procedure call or argument

    Please Login or Register  to view this content.
    However if I use Bulina2k's idea it will work but then I also need to have the image physically present somewhere to show it.

    Please Login or Register  to view this content.
    Your idea appeals more to me, but then I think I am missing either a reference in the VBA references that will interpret Application.CommandBars.GetImageMso correctly

    Thanks for the tips, both of you

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

    Re: Show an msoImage in a Userform (Excel 2010)

    tried the attached example.
    Attached Files Attached Files

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Thumbs up Re: Show an msoImage in a Userform (Excel 2010)

    Hi Andy, That's really strange. I compared the vba references in the attached file and her, they're identical and the attached file works and mine does not.

    I even exported the frm module and improted it an then it won't work

    Well, at least I've got worknign example. Thanks a million

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Re: Show an msoImage in a Userform (Excel 2010)

    BTW, how do I mark it solved in this forum?

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

    Re: Show an msoImage in a Userform (Excel 2010)

    to understand why yours is not working we would need to see what you have.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  14. #14
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Re: Show an msoImage in a Userform (Excel 2010)

    Here's the file I wrote ...
    Attached Files Attached Files

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

    Re: Show an msoImage in a Userform (Excel 2010)

    AccessNavigationOptions.jpg is not a valid msoImage name.

    Change the contents of the textbox to Copy and double click the textbox

  16. #16
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,904

    Re: Show an msoImage in a Userform (Excel 2010)

    My dumb mistake for taking the name with th file extension.

    Thanks dumb of me

+ 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] Inspect document doesn't show anything, Excel 2010
    By abbassi in forum Excel General
    Replies: 5
    Last Post: 07-01-2014, 01:42 AM
  2. Replies: 10
    Last Post: 08-20-2013, 01:02 PM
  3. Excel 2010 show how many times each text appears
    By umen in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 01-23-2013, 03:57 PM
  4. Replies: 0
    Last Post: 01-16-2013, 03:40 AM
  5. [SOLVED] Excel 2010 VBA Userform Coding - Help?
    By AmandaSanger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2012, 02:00 PM

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