Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
575 views
in Technique[技术] by (71.8m points)

vba - Programmatic Access To Visual Basic Project Is Not Trusted

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.

The one that didn't work opened Excel but had an error saying:

"programmatic access to visual basic project is not trusted".

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.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

File -> Options -> Trust Center -> Trust Center Setttings -> Macro Settings -> Trust Access to the VBA Project object model.

enter image description here

enter image description here

This is usually needed if you are referencing Extensibility library.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...