Share data between two xlls

Dec 6, 2014 at 10:36 PM
Hi,

I have two Excel DNA xlls A and B, both of which depend on a third dll C. I noticed that static constructors in C were called twice and static variables were not shared between the two Xlls. After reading some other posts, I realized that it was because two xlls were loaded into two different AppDomain.

To tackled this issue, I added some UDF in A for accessing data in C and then B use that UDF by Application.run, rather than both A and B try to access data in C directly. However, A and B still cannot share the static data in C, which means A and B trigger two different AppDomain again. I don't quite understand why.

Could you please help?

Thanks,
CR
Dec 6, 2014 at 11:21 PM
To update, actually my trick worked. Thanks.