.net CLR在VBA中的后期绑定(访问) [英] Late binding of .net CLR in VBA (Access)

查看:121
本文介绍了.net CLR在VBA中的后期绑定(访问)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的文章中,它展示了如何使用VBA,创建CLR的实例并因此调用/使用/使用.net COM对象而无需注册此类对象.

In the follow post it shows how one can use VBA, create a instance of the CLR and thus call/use/consume .net COM objects without having to register such objects.

并排使用C#和VBA的COM互操作

我希望替换此代码:

Dim Host As mscoree.CorRuntimeHost
Set Host = New CorRuntimeHost

使用

Set Host = createObject("mscoree.CorRunTimeHost")

我找不到班级"名称.

换句话说,我想晚绑定CLR.有谁知道是否可以使用VBA CreateObject()代替从VBA到上述mscore的硬引用

In other words, I want to late bind the CLR. Does anyone know if it is possible to use VBA CreateObject() in place of the having a hard reference from VBA to the above mscore

在VBA->工具中设置的参考"是

The "reference" set in VBA - > tools is

C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoree.tlb

实际上,我希望通过CreateObject()后期绑定.net CLR的使用

In effect I looking to late bind use of the .net CLR via CreateObject()

推荐答案

我认为您可能需要先注册typelib(无法确认ATM,因为我在搜索类名之前已使用regtlibv12.exe进行了注册. ).该类名称似乎是"CLRMetaData.CorRunTimeHost".

I believe you may need to register the typelib first (can't confirm ATM because I used regtlibv12.exe to register it before I went hunting for the class name). The class name appears to be "CLRMetaData.CorRunTimeHost".

这篇关于.net CLR在VBA中的后期绑定(访问)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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