将外部类库DLL文件引用到VBA时找不到项目或库 [英] Can't find project or library while refer an external class library DLL file to VBA

查看:319
本文介绍了将外部类库DLL文件引用到VBA时找不到项目或库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel模板,需要使用我们的数据库验证用户数据.
为此,我创建了一个类库,并在其中添加了所有验证功能,并且在类中也对连接字符串进行了硬编码,然后我将类库DLL引用到VBA.

运行宏时,所有功能均在我的系统中按预期工作!.
不幸的是,当此模板在另一个系统中签入时,它会显示

I have an Excel template ,that needs to be validated the user data with our DB.
For that I made a class library and where I added all validate functions,with the connection string also hard coded in the class,then I made a reference the class library DLL to the VBA.

While running the macro the functionality all are working as expected in my system!.
Unfortunately when this template checking in another system it says

Can''t find project or library



我尝试过的事情:

我尝试通过编程方式使用该参考,但是这些都没有帮助我
excel-如何以编程方式添加参考-堆栈溢出 [ ^ ]



What I have tried:

I tried it for using the reference by programmatically but none of those helped me
excel - How to add a reference programmatically - Stack Overflow[^]

推荐答案

这里有一些我遇到相同问题时尝试过的技巧

1)检查新解决方案的项目是否与您要包含的项目的兼容框架兼容.我试图在3.5项目中包含对4.0项目的引用.

2)尝试正常清理项目并重建,关闭所有Visual Studio实例并重新启动它们

3)一种可能性是类库的目标.NET Framework版本高于项目的版本.

4)尝试清除缓存
工具->选项-> resharper->选项->一般->单击清除缓存按钮,然后重新启动VS
few tips here which I have tried when I had the same issue

1) Check that the new solution''s projects run against a compatible framework to the project you''re trying to include. I was trying to include a reference to a 4.0 project in a 3.5 project.

2) Try the normal cleaning of the projects and rebuilding, shutting down all Visual Studio instances and restart them

3) One possibility is that the target .NET Framework version of the class library is higher than that of the project.

4) Try to clear caches
tools->options->resharper->options-> general-> click the clear caches button and restart VS


这篇关于将外部类库DLL文件引用到VBA时找不到项目或库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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