vb.net - How to make changes in Ribbon elements of a single excel instance, using application-level add-in? -


i'm using vsto vb.net excel 2013. i'm developing application-level add-in, can't make 2 different workbooks store different "ribbon state". example, when want enable button, use following code:

globals.ribbons.ribbon1.mybutton.enable = false 

this makes element "mybutton" disabled on each opened workbook, want make disabled 1 workbook.

the way i'm doing handle event workbookactivate, change ribbon state. problem is: way, user sees invalid state @ other workbooks not on top.

there better workaround? there isn't way manage ribbon instances (and not global element doing)?

thanks

there better workaround? there isn't way manage ribbon instances (and not global element doing)?

you need use callbacks instead. try use getenabled callback instead.

moreover, when required can use iribbonui interface methods force office applications update ui controls. invalidate method invalidates cached values of controls of ribbon user interface. see overview of iribbonui object .

you can read more ribbon ui (aka fluent ui) in following series of articles in msdn:


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -