+ Reply to Thread
Results 1 to 16 of 16

Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

  1. #1
    Registered User
    Join Date
    07-10-2019
    Location
    Bangalore
    MS-Off Ver
    1906
    Posts
    7

    Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Hello,

    Need help with below query as I am new to Excel, VBA.

    I have created buttons with the help of VBA Code on Add-ins. How can I make the button size larger (change the size)? I have tried methods like height and width but they did not help me.

    part of the code:

    Please Login or Register  to view this content.
    oControl is CommandBarControl

    I have tried oControl.Height and oControl.Width but it did not help. Thanks
    Last edited by kuldeepnpatel; 07-10-2019 at 01:57 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future

    https://www.excelguru.ca/forums/show...Custom-Toolbar
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    why not just set the button size in the properties window? do you know how to do that?

    what is oBar?
    Last edited by dmcgov; 07-10-2019 at 09:20 AM.

  5. #5
    Registered User
    Join Date
    07-10-2019
    Location
    Bangalore
    MS-Off Ver
    1906
    Posts
    7

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Hello Alan,

    I have tried 3 times to Edit the post to provide the URL. But It was not updating it. Thanks

  6. #6
    Registered User
    Join Date
    07-10-2019
    Location
    Bangalore
    MS-Off Ver
    1906
    Posts
    7

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Hello dmcgov ,

    Thanks a lot. Can you Please explain me How to change the button(Button present on Add ins tab) size in the properties window?

    oBar is CommandBar

  7. #7
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    oh, now i see why your height and width didn't work as i was thinking this was a commandbutton. i would recommend that you use https://www.andypope.info/vba/ribboneditor.htm andy popes ribbonx designer. that might be able to change the size of the buttons. i used it in an AddIn that i created and needed to change the icons. but you should be able to set the size using that program. let me know if you need help, note that andy gives an email address (don't have it) that you can communicate with him on questions.

    found his address:

    To contact me directly please use
    Email: [email protected]
    Last edited by dmcgov; 07-10-2019 at 11:43 AM.

  8. #8
    Registered User
    Join Date
    07-10-2019
    Location
    Bangalore
    MS-Off Ver
    1906
    Posts
    7

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Thanks! Yeah But I have to Install RibbonX Visual Designer in this case.I have tried with Custom UI Editor which requires XML code. So, Is there any way to make changes in VBA code to increase the button size without using XML ? Please let me know.

    Thanks again!

  9. #9
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    that is probably a question for the guru's as i don't know the answer to your question. my though is that it would have to be done in XML as this is the only way to modify the button on the menu

  10. #10
    Registered User
    Join Date
    07-10-2019
    Location
    Bangalore
    MS-Off Ver
    1906
    Posts
    7

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Okay, Many Thanks.

  11. #11
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    just to confirm (im in contact with andy), your talking about a button in the ribbon and NOT the quick access toolbar?

  12. #12
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    so there are two sizes for xml, small and large that can be set with the ribbonx designer (if you want to give that a try). since i'm a little bit knowledgeable with ribbonx, i will try to answer your questions.

  13. #13
    Registered User
    Join Date
    07-10-2019
    Location
    Bangalore
    MS-Off Ver
    1906
    Posts
    7

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Quote Originally Posted by dmcgov View Post
    just to confirm (im in contact with andy), your talking about a button in the ribbon and NOT the quick access toolbar?

    Yes, I am talking about a button in the ribbon.

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

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Currently you are using the old CommandBar object to generate the button. By default those buttons are added to groups in the AddIns tab. I don't believe you can control the size the button when it is automatically placed there.

    If you use ribbon xml to create your own tab/group/buttons you can use the size property of Large. You can edit the xml with customui editor or the ribbon editor.
    Cheers
    Andy
    www.andypope.info

  15. #15
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    thanks andy (appreciate you chiming in). so wish i had your knowledge. great site.

  16. #16
    Registered User
    Join Date
    07-10-2019
    Location
    Bangalore
    MS-Off Ver
    1906
    Posts
    7

    Re: Change the size of button present on Add-ins Custom Toolbar (VBA Code, Excel)

    Thanks a lot Andy and dmcgov.

+ 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. Excel 2002 Toolbar Hide Custom Button Macro
    By Optorock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2018, 01:00 AM
  2. Add toolbar button for custom formatting - Excel 2013
    By mateoc15 in forum Excel General
    Replies: 1
    Last Post: 08-06-2014, 09:43 AM
  3. Replies: 0
    Last Post: 08-11-2006, 02:18 PM
  4. Replies: 0
    Last Post: 08-08-2006, 01:40 AM
  5. how to increase size of button's image of custom toolbar of Excel
    By Padam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2006, 10:40 AM
  6. [SOLVED] Custom button on toolbar
    By Jack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2006, 05:15 PM
  7. [SOLVED] Add standard excel button to custom toolbar menu
    By Gixxer_J_97 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-21-2005, 03:20 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