use*_*643 2 c# dll excel-2007 regasm windows-vista
.Net Excel.dll在另一台计算机上部署和注册 aCan't add a reference to the specified file时,尝试DLL在VBA编辑器中添加引用时出现错误。
我已经创造了Excel.dll在C#中Visual Studio与运行正常我的机器上Windows 7和Office 2010。Excel VBA在我的计算机上的编辑器中添加对 dll 的引用没问题。我的问题是部署在另一台正在运行的机器上,Vista并且Excel 2007. 我把dll复制到这台电脑上,用来regasm注册dll。
任何人都可以指出我正确的方向吗?这里是代码和 regasm:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe excelDll.dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace TestDll
{
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Test
{
public string HelloWorld
{
get
{
return "Hello World";
}
}
public void sayGoodbye1()
{
MessageBox.Show("Say Goodbye");
}
public string sayGoodbye2()
{
return "Say Goodbye";
}
}
}
Run Code Online (Sandbox Code Playgroud)