none
Can I instantiate more than one AddIn Excel class? RRS feed

  • Question

  • I am creating an Excel AddIn using VSTO(VS 2012).

    I want to instantiate more than one WPF Map control for Excel AddIn so that I can relate Maps  to Excel workbooks opened one after the other. (Once Map is closed then related Workbook should also close and vice versa.)

    Currently only Map can be instantiated and based on Workbook chosen Map is getting attached to it. 

     
    • Edited by Animesh.Dash Wednesday, September 30, 2015 10:34 AM
    Wednesday, September 30, 2015 10:33 AM

All replies

  • Hi Animesh,

    If you mean you want to instantiate multiple ThisAddIn class, I am afraid that it is impossible.

    >> I want to instantiate more than one WPF Map control for Excel AddIn so that I can relate Maps  to Excel workbooks opened one after the other. (Once Map is closed then related Workbook should also close and vice versa.)

    Where did you use wpf map control, in ribbon, task pane or other place? I am not familiar with wpf, and I did not know what is map control. Let me talk about a button control, if you develop application level add-in, every workbook will have separate button control. If your workbook close, the control will be closed. If you want to close workbook from the control, you need to write related event.

    >> Currently only Map can be instantiated and based on Workbook chosen Map is getting attached to it.
    If you want every workbook has different map, I think vsto has achieved it. If I misunderstood you, please feel free to let me know.

    Best Regards,

    Edward


    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, October 1, 2015 7:20 AM
  • Hi Edward,

    Thanks for your response.

    Actually I am able to close WPF map (windows control) upon closing the linked Excel workbook. 

    But if I want to open multiple Excel workbook and their linked multiple WPF map objects then it is not happening.

    Only one map object is opening for multiple excel workbooks.

    Please suggest.

    Best Regards,

    Animesh

    Monday, October 5, 2015 12:37 PM
  • Hi Animesh,

    >> But if I want to open multiple Excel workbook and their linked multiple WPF map objects then it is not happening.

    Where did you store WPF map in your workbook, with a task pane? If you develop a task pane and when you open multiple workbooks, some of workbooks did not show up task pane, I suggest you uncheck the com add-in and then recheck the com add-in to check whether the task pane show up.

    If I misunderstood you, it would be helpful if you could share us steps to reproduce your issue and a screen shot would be helpful for us to understand your issue.

    Best Regards,

    Edward


    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.


    Wednesday, October 7, 2015 5:57 AM
  • Hi Edward,

    No I am not able to display Windows Form Control having WPF map control inside task pane.

    So I am displaying the same in a form separate from Excel workbook.

    Though I can link workbook and form I am not able to open multiple workbook with 1:1 form associated i.e. three workbook with three windows form control.

    Is it possible to have it?

    Thanks,

    Animesh

    Friday, October 9, 2015 6:10 AM
  • Hi Animesh,

    >> I am displaying the same in a form separate from Excel workbook

    How did you display WPF map in a form from Excel workbook and how did you link workbook and your form? Could you share us some key code about this?

    Best Regards,

    Edward


    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, October 9, 2015 8:24 AM