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.
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:
import win32api
import win32con
key = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER,
"Software\\Microsoft\\Office\\16.0\\Excel"
+ "\\Security", 0, win32con.KEY_ALL_ACCESS)
win32api.RegSetValueEx(key, "AccessVBOM", 0, win32con.REG_DWORD, 1)
Ref:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With