« Getting started with ExcelDna | Main | Minor update - version 0.2 »

Comments

Boon Cheong

First of all, nice work!

I was testing the Describe method as given in one of your examples. I found that when implementing the method, with AllowReference=true, within a compile library, argument of an ExcelReference will result in "!?Unheard Of" instead of "Reference: ..."

govert

Hi Boon,
The type you see in the compiled library is not the same as the type in the ExcelDna marshaler, causing this problem. There are some unresolved issues with referencing and loading of assemblies which I don't have great answers to yet :-(
When you create your .dll you should reference a copy (perhaps renamed to .dll) of the .xll library that you will use at runtime. (Note that the add-in does not actually have to be called .xll, it can be .dll too). However, the trick is for there to be only one copy when loaded up in Excel. If the referenced file is not there, I catch the load failure and retrun the loaded assembly.
Let me know if this doesn't work (I haven't actually checked) or if you have more questions.
Cheers, Govert

Boon Cheong

Many thanks for your reply. I tried your trick and it was working!

I created my compiled libary using Visual Studio 2005 and I renamed ExcelDna.xll to ExcelDna.dll before referencing it.

surya

i need to make a particular column of excel as an hyper link. i am using vstor excel application vb.net

spencer

This is really intriguing. It seems to work well in my basic tests, but I am having a problem where the function is volatile. For example, if I am use this, Excel doesn't recalculate automatically. Ideas?
public static double r()
{
Random r = new Random();
return r.NextDouble();
}

The comments to this entry are closed.