none
Synchronize checkboxes state on Excel2010 Ribbon RRS feed

  • Question

  • I added a custom ribbon UI on excel2010.
    On the UI, there is a checkbox. 
    When more than two excel2010s are executed, I want to synchronize all the checkboxes of these excel2010s.
    For example,
    When the checkbox is checked on in an excel2010, I want all other checkboxes to be synchronized and to be checked on.
    Please let me know the good solution.
    Friday, February 27, 2015 5:13 AM

Answers

All replies

  • Hello,

    > When more than two excel2010s are executed

    Are they started in the single process or separate one?

    The fact is that if they are separate processes, you need to synchronize the value set using WCF (.Net remoting) or keep it in the file which both add-in instances can access. The single add-in instance will be used in case of the single process (two Excel windows are opened in the single process). There is no need to do anything in that case, you may keep the value in a variable in the code.

    Anyway, you need to use callbacks to synchronize the value set. The checkbox element provides the getPressed callback which allows you to specify whether the checkBox control is pressed or not. You can read more about that in the series of articles in MSDN:

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

    Friday, February 27, 2015 9:38 AM
  • Thank you for your reply.

    >Are they started in the single process or separate one?
    They are separate processes.

    >Anyway, you need to use callbacks to synchronize the value set.
    >The checkbox element provides the getPressed callback which allows
    >you to specify whether the checkBox control is pressed or not. 

    Yes, I want to use getPressed callback to synchronize.

    Suppose two Excel2010 processes are running,
    process1
    process2

    When the checkbox is clicked on process1, I want to send some kind of event to process2 that can trigger a getPressed callback. But, I could not find the method.


    Friday, February 27, 2015 1:47 PM
  • Hi Chutorotoro,

    >>Suppose two Excel2010 processes are running,
    process1
    process2

    When the checkbox is clicked on process1, I want to send some kind of event to process2 that can trigger a getPressed callback. But, I could not find the method.<<

    If you are running two Excel processes, there are two instance of domain for the add-in are created. As far as I know, there is no such way we can communicate the across the domain in VSTO solution.

    Regards & Fei


    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.

    Monday, March 2, 2015 5:28 AM
    Moderator
  • You need to use WCF (.Net remoting) for communicating between different processes.

    There is no trivial way to get the job done.

    Monday, March 2, 2015 7:24 AM