部署一个Excel UDF [英] Deploying an Excel UDF

查看:169
本文介绍了部署一个Excel UDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel UDF调用Web服务。该UDF code是一个自动化插件code这是一个C#类库和我创建了一个安装它。当我运行的成立,对特定插件code没有提及出现在TOOS - >加载项 - Excel中>自动化加载项列表和功能不会在公式栏中apepar。我使用VS 2008和Excel 2003。

I have an excel UDF that calls a web service . The UDF code is an automation addin code which is a C# class library and I created an installer for it. When I run the set up, no reference to the particular addin code appears in the toos-->addins-->automation addins list of excel and the function does not apepar in the formula bar. I am using VS 2008 and Excel 2003.

我失去了一些东西在这里?我应该定义Excel有从东西挑DLL,以便它指向从UDF code生成的DLL的路径?或者是有一个必须注意一些安全问题?在客户机中有设置为完全信任安全级别尚插件没有出现在列表中。

Am I missing something here ? Should I define the path that Excel has to pick the dll from to something so that it points to the dll generated from the udf code? Or is there any security issues that has to be taken care of ? The client machine has the security levels set to Full Trust yet the addin does not appear in the list.

我失去了一些东西在这里?

Am I missing something here ?

推荐答案

这是因为安装自动化加载项要求定制的CLSID {GUID} \\可编程条目在注册表中,其中,创建时进行自动化插件,通常是由包括标有<一个处理方法href=\"http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comregisterfunctionattribute.aspx\"> ComRegisterFunctionAttribute 和<一个href=\"http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comunregisterfunctionattribute(VS.80).aspx\"> ComUnregisterFunctionAttribute类中的。当您在运行组装这些RegAsm类,然后注册。

This occurs because installing an automation add-in requires that a custom "CLSID{GUID}\Programmable" entry be made in the registry, which, when creating an automation add-in, is normally handled by including methods marked with the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute within your class. These classes are then registered when you run RegAsm on your assembly.

在使用Visual Studio安装包,但是,ComRegisterFunctionAttribute和ComUnregisterFunctionAttribute正在悄悄地忽略。这是因为安装项目运行RegAsm以生成一个包含所有必需的注册表项的.reg文件使用/ REGFILE开关。这是当.msi包是在客户现场运行,然后利用该.reg文件。的问题是,当RegAsm通过/ REGFILE开关运行,将所得reg文件不包含由用户定义的寄存器的功能(例如,那些标有ComRegisterFunctionAttribute和ComUnregisterFunctionAttribute)

When using a Visual Studio Setup Package, however, the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute are quietly ignored. This occurs because the Setup Project runs RegAsm using the /regfile switch in order to generate a .reg file containing all of the required registry keys. It is this .reg file that is then utilized when the .msi package is run at the client site. The problem is that when RegAsm runs via the /regfile switch, the resulting .reg file does not contain any registry updates made by user-defined register functions (e.g., those marked with the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute).

这样一来,是不是正在创建自定义的CLSID {GUID} \\可编程注册表项,因此,您的自动化加载项没有显示在自动化加载项列表中了。

As a result, your custom "CLSID{GUID}\Programmable" registry entry is not being created and, therefore, your automation add-in is not showing up in the automation add-ins list.

要纠正这种情况,你必须创建自己的自定义CLSID {GUID} \\可编程通过其他方式进入。这是最容易被利用的注册表编辑器部分要做到这一点安装程序包。

To remedy this situation, you must create your own, custom "CLSID{GUID}\Programmable" entry via another means. It is easiest to do this by making use of the Registry Editor section of the Setup Package.

正确处理所有步骤的安装包为自动化加载项是有些复杂。幸运的是,我对如何做到这一步一步的解释(以及为什么这是发生的更详细的描述)作为一个问题的答案:<一href=\"http://stackoverflow.com/questions/1506858/how-to-get-com-server-for-excel-written-in-vb-net-installed-and-registered-in-aut/1506932#1506932\">How获得COM服务器的写在VB.NET Excel中安装和自动化服务器列表注册。

Correctly handling all the steps for a Setup Package for an automation add-in is somewhat complicated. Fortunately, I have a step-by-step explanation of how to do this (as well as a more detailed description of why this is occurring) as an answer to the question: How to get COM Server for Excel written in VB.NET installed and registered in Automation Servers list.

希望这有助于!

迈克

这篇关于部署一个Excel UDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆