I am writting an MS Excel COM-Addin in Delphi 2006. I'm have Excel 2007 installed on my development machine.
I started the project as an ActiveX Library and then added an Automation object from the Delphi ActiveX project menu.
In my automation object I defined the IDTExtensibility2 interface as
IDTExtensibility2 = interface(IDispatch)
['{32E456FC-C710-43AA-9ACA-DDE8F132B91B}']
function OnAddinsUpdate(var w_Custom: OleVariant): HResult; stdcall;
function OnBeginShutDown(var w_Custom: OleVariant): HResult; stdcall;
function OnConnection(const w_Application: IDispatch; w_ConnectMode: Integer;
const w_AddInInst: IDispatch; var w_Custom: OleVariant): HResult; stdcall;
function OnDisconnection(w_DisconnectMode: Integer; var w_Custom: OleVariant): HResult; stdcall;
function OnStartupComplete(var w_Custom: OleVariant): HResult; stdcall;
end;
and implemented the interface in a class that derived from TAutoObject.
In the initialization section of the unit I call
TAutoObjectFactory.Create(ComServer, TPBSExcelAddin, Class_PBSExcelAddin, ciSingleInstance, tmApartment);
com object registers fine and shows up in Excel Addin options however it will in install in excel. I just get the error "Not loaded. An error has occurred during the loading of the COM Addin"
Can anyone see a problem with my interface? or the way I am creating the com object? is there a way to debug this?
Thank you