Hide Excel Task pane

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

Hide Excel Task pane
How to hide the Excel task pane when Excel Instance Opens 
C-MOTS


Guest


Hi friends,

I am new to Addin Express, I am trying to hide the Excel Task pane by default and only to be visible when I Change to the Custom Tab added by me.
Posted 08 Aug, 2014 04:18:49 Top
Andrei Smolin


Add-in Express team


Posts: 18816
Joined: 2006-05-11
Hello,

To prevent a pane from showing, set ADXExcelTaskPane.Visible=false in the ADXExcelTaskPane.ADXBeforeTaskPaneShow event. See also the sample project titled "How to make an Excel task pane visible / invisible programmatically" at http://www.add-in-express.com/support/csharp-excel.php#task-panes.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Aug, 2014 04:47:27 Top
C-MOTS


Guest


Hi Andrei,

Thanks for the fast reply,
Now the Task pane is not visible but to make it visible again I am doing this

if (AdxCMTPM.Items[0].TaskPaneInstance.Visible) then
begin
AdxCMTPM.Items[0].TaskPaneInstance.Hide;
(Sender as TadxRibbonButton).Caption := 'Show Filters';
end
else
begin
AdxCMTPM.Items[0].TaskPaneInstance.Visible := true;
(Sender as TadxRibbonButton).Caption := 'Hide Filters';
end;

This has no effect.
Posted 08 Aug, 2014 05:25:40 Top
Andrei Smolin


Add-in Express team


Posts: 18816
Joined: 2006-05-11
Hello,

Sorry for pointing you to a wrong set of samples. Please check How to set the visibility of Advanced Excel Task Pane at http://www.add-in-express.com/support/delphi-excel.php.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Aug, 2014 06:07:11 Top
C-MOTS


Guest


Hello Andrei Smolin,

As you said To prevent a pane from showing, set ADXExcelTaskPane.Visible=false in the ADXExcelTaskPane.ADXBeforeTaskPaneShow event.

I am doing this setting the visible false on ADXBeforeTaskPaneShow

procedure TadxExcelTaskPane1.adxExcelTaskPaneADXBeforeTaskPaneShow(ASender: TObject; Args: TadxBeforeTaskPaneShowEventArgs);
begin
Self.Visible := false;
end;

And I am try to show the task pane on Ribbonbutton Click as below

procedure TAddInModule.adxCMRibbonControls0Controls0Click(Sender: TObject; const RibbonControl: IRibbonControl);
var
ExlTskPane: TadxExcelTaskPane;
begin
ExlTskPane := AdxCMTPM.Items[0].TaskPaneInstance;
if (ExlTskPane = nil) then
begin
ExlTskPane := AdxCMTPM.Items[0].CreateTaskPaneInstance;
ExlTskPane.Visible := true;
ExlTskPane.Show;
(Sender as TadxRibbonButton).Caption := 'Hide Filters';
end
else
begin
ExlTskPane.Hide;
(Sender as TadxRibbonButton).Caption := 'Show Filters';
end;
end;

ExlTskPane.Visible := true; -- this line shows false only even after the line is executed.

In the Examples given on the site the task pane is shown by default and I want it to be shown only on the button click by user.
Posted 11 Aug, 2014 08:09:57 Top
Andrei Smolin


Add-in Express team


Posts: 18816
Joined: 2006-05-11
Hello (what's your name?)

That because adxExcelTaskPaneADXBeforeTaskPaneShow sets Visible=False unconditionally.


Andrei Smolin
Add-in Express Team Leader
Posted 11 Aug, 2014 08:23:47 Top