Add controls to Excel taskpane at runtime

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

Add controls to Excel taskpane at runtime
 
Bob Devine


Guest


I've recently upgraded my ADX setup to the latest version with Delphi 10.3 (was previously XE7/ADX7) and adding controls to an Excel advanced taskpane at runtime no longer seems to work (my original code is unchanged). Even the simplified test code below doesn't show the panel - has something changed that I'm missing?

FNavigatorPane := ExcelTaskPanesManager.Items[cNavigatorIndex].TaskPaneInstance;
  if (FNavigatorPane = nil) then
    try
      FNavigatorPane := ExcelTaskPanesManager.Items[cNavigatorIndex].CreateTaskPaneInstance;
      FNavigatorPane.Caption := 'Workbook Navigator';
    except
      MessageDlg('Error creating navigator view.', mtError, [mbOk], 0);
    end;

  pnl := TPanel.Create(FNavigatorPane);
  pnl.Parent := FNavigatorPane;
  pnl.Align := alClient;
  pnl.Show;


Thanks, Bob
Posted 18 Feb, 2020 07:16:29 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Bob,

Could you send us a test project (the simpler the test project, the better) to the support email address? You find it in {Add-in Express installation folder}\readme.txt. Please make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 19 Feb, 2020 03:36:58 Top
Bob Devine


Guest


Hi Andrei - I figured it out thanks. The other variable I neglected to mention is that I'm now developing for Excel 2013 and so the AfterStartup event (which is where my code was located for Excel 2010) completes before the task pane is visible (because there's no default workbook). I therefore just moved my code to the WorkbookOpened event handler and it's working fine.

Cheers, Bob
Posted 19 Feb, 2020 09:17:13 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
It's great!


Andrei Smolin
Add-in Express Team Leader
Posted 19 Feb, 2020 09:21:28 Top