alanjbrown
asked on
Example code needed to link OleContainer to ExcelApplication
I am trying to connect an ExcelApplication server component to connect to an OleContainer.
something like
excelApplication1.ConnectT o(oleConta iner1.Obje ct);
However I can't get the syntax correct. Can someone please provide some sample code for this.
thanks
something like
excelApplication1.ConnectT
However I can't get the syntax correct. Can someone please provide some sample code for this.
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much. That was very helpful.
procedure TForm1.Button1Click(Sender
var xls: OleVariant;
itf: IDispatch;
xitf: _Workbook;
begin
OleContainer1.CreateObject
OleContainer1.DoVerb(0);
xls := OleContainer1.OleObject;
if OleContainer1.OleObjectInt
xitf := itf as _Workbook;
ExcelApplication1.ConnectT
ExcelApplication1.Range['A
end;
end;
ziolko.