Make Excel task pane visible and invisible programmatically

Add-in Express™ Support Service
That's what is more important than anything else

Make Excel task pane visible and invisible programmatically
 
Michael Hovdan


Guest


I need to make my Excel task pane go invisible when the active workbook doesn't pass a certain "format validation test", and be visible when the user opens or creates a workbook that passes the test.

How can I do this?
Posted 01 Jun, 2015 12:39:59 Top
Andrei Smolin


Add-in Express team


Posts: 18827
Joined: 2006-05-11
Hello Michael,

Please see How to set the visibility of Advanced Excel Task Pane at https://www.add-in-express.com/support/delphi-excel.php.


Andrei Smolin
Add-in Express Team Leader
Posted 02 Jun, 2015 03:46:48 Top
Micha? G??bowski


Guest


I'm not sure if this is proper approach, but for me it works. I assume, you already:
a) created Panel (File->New->Other->Add-in Express VCL->ADX Excel Task Pane)
b) added TadxExcelTaskPanesManager to your AddIn
c) added item to collection of TadxExcelTaskPanesManager and properly set at least:
Position and TaskPaneClassName for that item to indicate your panel and be placed.

First I don't need Panel to be seen at start of Excel, so:

1) I put two lines in OnADXBeforeTaskPaneShow

Self.Visible := Tag = 1;
Tag := 1;

2) From Add-in I can now show or hide panel using simply

MYadxExcelTaskPanesManager.Items[0].TaskPaneInstance.Show; // or .Hide

Hope that helps.
Michal
Posted 30 Jun, 2015 15:02:47 Top
Andrei Smolin


Add-in Express team


Posts: 18827
Joined: 2006-05-11
Hi Micha?,

That's a correct way of preventing the form from being shown at startup.


Andrei Smolin
Add-in Express Team Leader
Posted 01 Jul, 2015 02:43:09 Top