从vba应用程序以编程方式安装和引用.net dll [英] installing and Refereing .net dll programmatically from vba app

查看:95
本文介绍了从vba应用程序以编程方式安装和引用.net dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好专家,

我有我的dll,即.net制作的类库文件.和一个VBA应用程序.用vba应用程序编写的代码需要在该特定dll中编写的功能.如何引用该dll.

在.net中,它很容易,因为它遵循xcopy部署.但是由于我是vba的新手,所以我不知道该怎么做.由于我的vba文件将分发给各个客户端,因此我无法明确地进行引用.即转到工具,然后检查组件.应该以编程方式执行.

我需要在客户端计算机上安装.net dll吗?我问这个是因为,
由于我无法仅通过复制和粘贴找到dll.我所做的是写了CreateObject()方法.但是最终我在msdn链接上发现了此消息..."CreateObject():创建并返回对COM对象的引用.除非将这些类显式公开为COM组件,否则不能使用CreateObject在Visual Basic中创建类的实例."

任何人都可以提供任何提示或帮助...

我可以使用shell命令吗?

Hello Experts,

I have my dll i.e. class library file made in .net. and a vba application. The code written in vba app need a function written in that particular dll. How can I refer that dll.

In .net its easy, because it follows xcopy deployment. But as i am new to vba, I don''t know how to do it. Since my vba file will be distributed to the various clients, I can''t afford to make that reference explicitly. i.e. going to tool and then checking component. It should be performed programmatically.

Do I need to install my .net dll on client''s machine?? I am asking this because,
since I am not able find my dll with just copy and paste.. what I did is, I wrote CreateObject() method. But eventually I found this message on msdn link... "CreateObject():Creates and returns a reference to a COM object. CreateObject cannot be used to create instances of classes in Visual Basic unless those classes are explicitly exposed as COM components."

Anybody can give any hint or help please...

Can I do it by using shell command?? Does it help me to to register my dll on client''s machine (programmatically)??

推荐答案

您想要做的事情叫将.NET组件暴露给COM吗? .

请参阅 http://msdn.microsoft.com/en-us/library/zsfww439.aspx [ ^ ]
What you want to do is called exposing .NET components to COM.

See http://msdn.microsoft.com/en-us/library/zsfww439.aspx[^]


这篇关于从vba应用程序以编程方式安装和引用.net dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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