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 colleagues computer. One worked the other didn't.
The one that didn't worked 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.
Its very easy to do this in Python using the
pywin32
module by Mark Hammond.What the above post by @user2140173 does actually is to change some registry values. This can be programmatically accomplished by the
pywin32
module as follows:Ref:
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.
Mac Version - In the past there was no setting for this on the Mac version. You did get always a dialog saying the thing.
But now, at least with version 16.30, not sure how long ago, the Mac Users have the same setting available.
BTW, it is under security, not under trust.
HTH