ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update option button from c# (https://www.excelbanter.com/excel-programming/384722-update-option-button-c.html)

Lee

Update option button from c#
 
Hi,

I have a spreadsheet which contains several option buttons. Each
option button has a macro assigned.

I have a c# programme which uses the spreadsheet. I wish to simulate
the pressing of one of the option buttons. I have no problem running
whichever macro I need from my c# programme but I cannot find a way of
setting whichever option button.

Thanks
Lee


Tamar

Update option button from c#
 
you should put any optionbuttons that belong to eachother in one containing
frame. Then you give them names that make sense.

you set it's value-property to true by:

OptionButton1.value = True


"Lee" wrote:

Hi,

I have a spreadsheet which contains several option buttons. Each
option button has a macro assigned.

I have a c# programme which uses the spreadsheet. I wish to simulate
the pressing of one of the option buttons. I have no problem running
whichever macro I need from my c# programme but I cannot find a way of
setting whichever option button.

Thanks
Lee



Lee

Update option button from c#
 
Many thanks
I realised that I could simply set the option button within the macro
hence when the macro is run the option button is set.
i.e.
ActiveSheet.OptionButtons(1).Value = True
Lee



All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com