While there is no built-in support for the kind of object handling you
describe, it is not hard to make a simple implementation yourself. The
best search term to find related discussions is probably 'object
handles', with many pointers to threads for you to look through :
http://groups.google.com/group/exceldna/search?group=exceldna&q=object+handles&qt_g=Search+this+group.
There is quite a sophisticated implementation in the (pretty dormant)
ExcelDna.Contrib project, contributed by Rob Howley:
http://exceldnacontrib.codeplex.com/SourceControl/changeset/changes/47430.
I haven't used it myself, but it might give you a few ideas. Initial
discussions can probably be found on the group too:
http://groups.google.com/group/exceldna/search?group=exceldna&q=howley&qt_g=Search+this+group.
The main issue for a serious implementation is to deal with object
lifetime. Suppose you cache the object in some dictionary, returning a
handle to Excel that can be used for further access. How will your
object handler know that the object should release because it is no
longer referenced in any cell? I suspect the right implementation will
use an RTD server - these have a predictable lifecycle between the
Excel function calls and the RTD Server. Some implementation have
periodic checks for use, or even an 'object inspector' to peek behind
the scenes. But implementing this right is still not trivial.
Still, for porting your VBA add-in you could probably follow whatever
pattern worked there as a start.
Regards,
Govert
This is an awesome project dude - kudos
On Nov 23, 6:35 pm, Govert van Drimmelen <gov...@icon.co.za> wrote:
> Hi Dave,
>
> While there is no built-in support for the kind of object handling you
> describe, it is not hard to make a simple implementation yourself. The
> best search term to find related discussions is probably 'object
> handles', with many pointers to threads for you to look through :http://groups.google.com/group/exceldna/search?group=exceldna&q=objec....
>
> There is quite a sophisticated implementation in the (pretty dormant)
> ExcelDna.Contrib project, contributed by Rob Howley:http://exceldnacontrib.codeplex.com/SourceControl/changeset/changes/4....
> I haven't used it myself, but it might give you a few ideas. Initial
> discussions can probably be found on the group too:http://groups.google.com/group/exceldna/search?group=exceldna&q=howle....