Building Excel add-in with Excel

Just what is the best and/or easiest way of building an Excel custom add-in
in Delphi?

By using a DLL or ActiveX?

The problem surrounds the delivery of data from a custom legacy database
into Excel for end user query and reporting.

I want to specify a query to the underlying data source, the results of
which are then pushed back into a nominated block of cells in the Excel