Hi,great work, I am trying to do the same thing, but I don´t know how I can do.Can you please give me some tips?After I registe my method, how can I use it?When I registe my method I can´t registe my funclist and my arglist,ExcelIntegration.RegisterMethods(methodsList, funcList, argList);This code give me error: No overload for method 'RegisterMethods' takes 3 argumentsCan you please help me?
thanks,Dias
Terça-feira, 9 de Abril de 2013 21:22:22 UTC+1, gin...@gmail.com escreveu:Hi Govert,
Sorry for the late response. I was switched to work on something urgent for the last few weeks.
Yes, we are able to use it to do localization of the function. We just simply get the description from the resource file in the standard way and set up the function attribute fields before registering the method. Code example:
ExcelFunctionAttribute functionAttribute = new ExcelFunctionAttribute();
List<ExcelFunctionAttribute> funcList = new List<ExcelFunctionAttribute>();
functionAttribute.Name = "Total";
functionAttribute.Description = Properties.Resources.TotalDescription; // get the localized description
funcList.Add(functionAttribute);
...
ExcelIntegration.RegisterMethods(methodsList, funcList, argList); // register the methods
For the problem of the distributed xll, the exception is something like MSVCR110D.dll is missing. This is the VS2012 run-time dll. The problem occurs when I try to debug the add-in with VS2010. VS2012 installation replaces .Net 4 with .Net 4.5 and that causes some of existing .Net 4 applications to break. That's why we haven't upgraded to VS2012.
Thanks for the suggestion of using DynamicMethod, I'll give it a try later.
For the unregistering of the method. I don't really concern on unregistering the method from Excel, I can just set the hide attribute if I don't want the method to appear, and it seems Excel would just replace the method if the method with the same name is registered again. I only worry about the internal memory usage of Excel-DNA. For my application, I need to re-register the same methods whenever the arguments changed, the DNA internal method list will keep on growing because each one is allocated with a new id/slot. Instead of providing a unregister method, may be a better solution is to change the registering code to reuse the same id/slot if it detects the method with the same name is already exist in the list.
Thanks,
Gin
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at http://groups.google.com/group/exceldna?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Hi John,
You’ll probably have to implement this using the Excel-DNA Registration extension (https://github.com/Excel-DNA/Registration ), which would allow you to decide at runtime how to fill in the attribute information.
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.