问题描述
我的电脑上有两个计划任务.它们都打开 Excel 文件并运行宏 &他们所做的非常相似.他们都在我的电脑上工作.但是我将计划任务移到了同事的计算机上.一个工作另一个没有.
I have two scheduled tasks on my computer. They both open Excel files and run a macro & are pretty similar in what they do. They both work on my computer. However I moved the scheduled tasks onto a colleague's computer. One worked the other didn't.
那个没用的人打开了 Excel 但有一个错误说:
The one that didn't work opened Excel but had an error saying:
不信任以编程方式访问 Visual Basic 项目".
就像我说的,两个 Excel 文件非常相似.一个不起作用的项目确实引用了另外两个项目,而另一个则没有.他们是,
Like I say, both Excel files are very similar. The one that didn't work does reference two additional projects the other one does not. They are,
Microsoft Visual Basic for Applications Extensibility 5.3
Microsoft Windows Common Controls-2.6.0 (SP6)
我以前从未遇到过这个错误.
I have never come across this error before.
推荐答案
文件 -> 选项 -> 信任中心 -> 信任中心设置 -> 宏设置 -> 对 VBA 项目对象模型的信任访问.
File -> Options -> Trust Center -> Trust Center Setttings -> Macro Settings -> Trust Access to the VBA Project object model.
如果您要引用可扩展性库,通常需要这样做.
This is usually needed if you are referencing Extensibility library.
这篇关于对 Visual Basic 项目的编程访问不受信任的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!