0

I am using a WebBrowser control as part of an Excel Task Pane. We do not want to create a new one for every workbook created (this is in Excel 2013 where each workbook gets its own task pane) and try to keep them synced, so we have the task pane create an instance of a singleton browser control.

What happens is every workbook that opens gets the instance of this webbrowser control and it is shown for that workbook... and stops being displayed for other workbooks before it. This is ok, but I would like to be able to show the control on the active workbook's task pane when the user switches between open workbooks.

I have added the code to catch the Workbook Activate event, and when it calls in to show the webbrowser control, it is still pointing at the simgleton instance... I just do not know how to show the control again.

1 Answers1

1

I was finally able to do this by calling into the task pane control during the Workbook Activate event and removing the control from its container control and then adding it back to the container control. This is certainly not what I would call an ideal solution to this issue, but trying typical redraw calls did not work in this case. Now, the active workbook taskpane always shows the single webbrowser.

This webbrowser was much easier to implement with Excel 2010, since there is only one taskpane! Hope this helps someone else...