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




Posts: 13
Joined: 2014-07-29
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: 14106
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.

Regards from Belarus (GMT+3),

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




Posts: 13
Joined: 2014-07-29
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: 14106
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.

Regards from Belarus (GMT+3),

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




Posts: 13
Joined: 2014-07-29
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: 14106
Joined: 2006-05-11
Hello (what's your name?)

That because adxExcelTaskPaneADXBeforeTaskPaneShow sets Visible=False unconditionally.

Regards from Belarus (GMT+3),

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