I am trying create a simple Action Pane Control in a Document-level VSTO, writting in VB.Net. [.net 4.8]
With the code I have now I open the Action Pane on Sheet1 and hides it on other sheets.
The issue I can't find a solution to is to set the width of the action pane and its control - It is simple to narrow as default.
Every time the workbook is opened, the action pane opens with the default widt, so every single time you have to start out by resizing the action pane. That is an annoyance.
Example image:
Every topic I have found on this refers to setting the width as this ( link: actions-pane):
Me.CommandBars("Task Pane").Width = 200
or
Application.CommandBars("Task Pane").Width = 200
My code for sheet1:
(apcWareList is the Action Pane Control)
Imports Microsoft.Office.Interop.Excel
Public Class Sheet1
Private tpWareList As New apcWareList
Private Sub Sheet1_Startup() Handles Me.Startup
Globals.ThisWorkbook.ActionsPane.Controls.Add(tpWareList)
Application.CommandBars("Task Pane").Width = 500
Globals.ThisWorkbook.Application.DisplayDocumentActionTaskPane = True
End Sub
Private Sub Sheet1_Shutdown() Handles Me.Shutdown
End Sub
Private Sub Sheet1_Deactivate() Handles Me.Deactivate
Globals.ThisWorkbook.Application.DisplayDocumentActionTaskPane = False
End Sub
Private Sub Sheet1_ActivateEvent() Handles Me.ActivateEvent
Globals.ThisWorkbook.ActionsPane.Controls.Add(tpWareList)
Globals.ThisWorkbook.Application.DisplayDocumentActionTaskPane = True
End Sub
End Class
Anyone who can spot my error?