-3

How to create a simple customtaskpane using Delphi without add-in express and add customtaskpane to excel.

Taskpane will have 1 button(close )

procedure TMyAddin.OnConnection(const Application: IDispatch; ConnectMode: ext_ConnectMode; const AddInInst: IDispatch; var custom: PSafeArray);
var FApp:ExcelApplication;
CTP:TCustomTaskPane;
begin
...
  CTP:=TCustomTaskPane.Create(Self);
//?
  CTP.Visible:=True;
end;

using XE7,office2010.pas,excel2010.pas

Ranga MK
  • 43
  • 11
  • What have you achieved so far? How have you implemented your add-in? Did you read the MS documentation on how to make task panes? – David Heffernan Jun 19 '15 at 07:51
  • @DavidHeffernan 1.so far on this only `ntp:=TCustomTaskPane.Create(nil);` 2.yes i did implement the add-in and ribbon control(i cannot post code because of NDA) . 3.yes i did read ms-documentation but example shows `myCustomTaskPane = Me.CustomTaskPanes.Add(myUserControl1, "My Task Pane")` which i do not understand. – Ranga MK Jun 19 '15 at 09:10
  • That looks like the VSTO docs. You'll need to use the COM API. I can't see how I could offer any help given that I cannot see any of your code. – David Heffernan Jun 19 '15 at 09:13
  • We cannot know what TCustomTaskPane is. I don't see how we can help. Unless you hope that we'll write all the code for you. – David Heffernan Jun 20 '15 at 10:17

1 Answers1

0

Managed to do it myself. For anyone who have same issue, posting solution here

  • Create add-in
  • Add ActiveX form to add-in project
  • Add below code to addin .pas file
procedure TmyAddin.CTPFactoryAvailable(const CTPFactoryInst: ICTPFactory); safecall;
Var 
    CTP: _CustomTaskPane;
//  NP: TActiveXformClass;
begin   
    CTP:= CTPFactoryInst.CreateCTP('<replace with add-in name>.<replace with activeXform name>', 'pane caption', EmptyParam);
//  NP := TNavigationPane(ctp.ContentControl);
    CTP.Visible := true;
end;
Ranga MK
  • 43
  • 11