Michael Kaden
Guest
|
Hello,
I understand from ADX documentation one cannot use the Excel Object Model within an ADX XLL AddInn.
I have now done the following
Created an ADX XLL
Created a UDF within the XLL Container
Created a new class outside of the XLL Module
Created a Function in the new class
The UDF passes caller information (workbook.Fullname / sheet.Name / cell.address as string) to the new function
the new function uses the getObject(Workbook.FullName) to link to the calling workbook/worksheet/cell
The new function does for example:
Add up 2 offset cells from the caller cell and returns this to the UDF as result.
or
Set the Workbook calculation mode to Excel.XlCalculation.xlCalculationManual
or
read or writes to Workbook.CustomDocumentProperties
all this works perfect.
is this normal and did I misunderstand the quote that ADX XLL AddIn cannot use Excel Objects?
ps I registered my project for COM Interop
regards
Michael |
|
Andrei Smolin
Add-in Express team
Posts: 18825
Joined: 2006-05-11
|
Michael,
You do this on your risk. The Excel SDK doesn't promise to support a call to the Excel object model when your XLL function is called.
To be absolutely precise, I need to provide this piece of knowledge: they removed a page that explicitly explained why you cannot issue an object model call from your XLL. I don't know when this occured. You can find the URL of that page is mentioned in the Add-in Express manual; see section Using the Excel Object Model in an XLL. I don't know if this means that they allow object model calls. I'm pretty sure, though, they could not allow such calls in older Excel versions.
Andrei Smolin
Add-in Express Team Leader |
|