none
Button on a Worksheet RRS feed

  • Question

  • Hi All,

    I have created Command Button(with an image inside it) by following this blog, it's working perfectly fine. My button looks like this :  

    but I want it to look exactly like this: 

    So this is my problem Is there any way I can format it like my desired outcome. There is nothing in it's properties that I can for work with. 

    Thanks,


    Attiqe Ur Rehman

    Wednesday, February 19, 2014 1:52 PM

Answers

All replies

  • I'm afraid your request isn't clear because the desired end-result doesn't appear in the same context as the starting point.

    In the first image, we see two Excel column headers and the first cell; in the second, we don't see these so it's difficult to be sure what it is you want. Are you saying your button should have text and a dropdown arrow? Then you need to create a graphic that looks like that...


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 19, 2014 3:01 PM
    Moderator
  • Cindy,

    Thanks for your reply. I am only interested in button not columns I just want to custom button(shown in first image) to look like Excel created button(shown in second image).  

    Thanks,

    Attiqe


    Attiqe Ur Rehman

    Wednesday, February 19, 2014 3:04 PM
  • Hi Attique

    Mmm, what you show in the second graphic is not a "button", it's a dropdown control. Do you want to show a dropdown list?

    Basically, if you want a button to look like what you show us then you need to create a graphic of what you want to show and put that on your button as an image...


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 19, 2014 4:00 PM
    Moderator
  • Cindy,

    The second button is I think button because it looks and act like one. For example if you just insert a table anywhere on the worksheet you will be able to see that button. 

    I have created that graphic  and I have also put it on my button, first image in an example of it. It's just that I am unable to format it like the second button. 

    Thanks,


    Attiqe Ur Rehman

    Wednesday, February 19, 2014 4:06 PM
  • Hi Attiqe,

    According to your description, you want to create a control in an Excel Add-in as the same as the built-in filter in Excel cells.

    From my understanding, the control below is similar with an Office ribbon control named ‘splitbutton’ (See the thread: Duplicate Word Ribbon Built-in SplitButton Control), there would be a panel displayed after clicking the icon and we could custom the panel with many other controls embedded.

    In Excel, when we changed the size of any cell, the built-in filter would always change according to the cell changed. However, we can’t handle such behavior because there is no such event from Excel Object Model (e.g. Workbook events, Worksheet events).

    So, firstly, we can create a similar control as what you want in VSTO.

    Secondly, we can’t make the control size (coordinates, width and height) as the same as any cell while the cell size changed.

    Hope this helps.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 20, 2014 9:58 AM
    Moderator
  • George,

    Thanks for your reply that's exactly what I want "you want to create a control in an Excel Add-in as the same as the built-in filter in Excel cells" but the link-https://dl.dropboxusercontent.com/u/64545773/Splitbutton%20Advanced.dotm- mentioned in the answer is no longer available. 

    Thanks,


    Attiqe Ur Rehman

    Thursday, February 20, 2014 12:03 PM
  • Hi Attiqe,

    The link (https://dl.dropboxusercontent.com/u/64545773/Splitbutton%20Advanced.dotm) is available for me.

    I have uploaded the file to SkyDrive for your downloading:

    https://onedrive.live.com/redir?resid=AD77AE76D657E280%21142

    Open the link then click File menu - > save as.

    I notice that you want to insert such control into worksheet, I'm afraid it is hard to do.

    What I said is in ribbon, splitbutton is an Office Ribbon control that can be hosted in the ribbon. For OLE controls, I haven't found the similar one.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 21, 2014 2:05 AM
    Moderator