在Excel中使用VSTO创建UDF [英] Creating UDF with VSTO in Excel
问题描述
我知道如何在简单的情况下做到这一点:$ b $ b http://geekswithblogs.net/Denis/archive/2007/01/03/102623.aspx
I know how I can do this for the simple case as details here: http://geekswithblogs.net/Denis/archive/2007/01/03/102623.aspx
但是,我试图做的是当我在Excel中选择我的类别我想要能够在运行时动态填充功能列表。
But what I'm trying to do is when my category is selected in Excel I want to be able to dynamically populate the function list at run-time.
就是这样,它使用全部类中的公共函数DLL。有没有一些方法可以挂起填充这个列表的事件并告诉它使用什么?或者可能动态地将一些代码注入到DLL中,在这种情况下,我可以在运行时将一些公共函数插入到DLL中,因此在函数列表中需要我的任何东西。
As is, it's populated using all public function in the category DLL. Is there some way of hooking into the event that populates this list and telling it what to use? Or maybe injecting some code into the DLL dynamically, in this case I could insert a bunch of public functions into the DLL at run time and so have what I want in the function list
推荐答案
使用ExcelDna - http://www.codeplex.com/exceldna -
您可以在运行时显式注册函数。但是,我不认为显示功能列表是否容易,因此您可能需要有一个菜单项或填充列表的内容。
With ExcelDna - http://www.codeplex.com/exceldna - you can explicitly register the functions at runtime. However, I don't think it is easy to know when the function list is displayed, so you might have to have a menu items or something that fills the list.
这篇关于在Excel中使用VSTO创建UDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!