I have problem with one CustomTaskPane in mutiple Excel 2016 documents. I create and display task pane with my WinForm user control
Dim cll As cMyControl = New cMyControl
Private Sub ThisAddIn_Startup() Handles Me.Startup
CustomTaskPanes.Add(cll, "Panel")
End Sub
This panel I can see in all workbook.
Private Sub Application_WorkbookActivate(Wb As Microsoft.Office.Interop.Excel.Workbook) Handles Application.WorkbookActivate
CustomTaskPanes.RemoveAt(0)
CustomTaskPanes.Add(cll, "Panel")
End Sub
The problem is that the panel is created but empty. Is any way how to transfer user control between CustomTaskPanels? Or how to attach created panel to another Excel window? Because the I don't want to create new cll
object for each workbook activation.