enable macro

zezo2021

Member
Local time
Today, 16:01
Joined
Mar 25, 2021
Messages
412
is there any code that can enable macro ++auto++ when applications start
in case user computer macro is disappled
 
Search for Trust Center Settings on AWF, there are a lot of ways to approach the general subject of overcoming Trust Center blocks to ideal database usage. They range from Trusted Locations, Registry edits, and (IMO) .accdr which doesn't auto-overcome it, it just ensures your db will not 'open' with automation disabled. And probably more I am not thinking of. You might want to find threads where this discussion already has been had and begin forming some ideas of which approach might work best in your environment.

Another option is to train your users on a one-time Trust Center Settings change. (this is especially good for Excel).

Which option makes sense for you will depend a lot on how locked-down your deployment environment is, how many users you have, whether your users' Office versions are known and similar or totally unpredictable, etc.

I used the registry editing method years ago in an environment where everyone had the same Office install. Nowadays I more often just use .accdr extension, which gives users a pretty simple choice: Either click "Yes" or you can't open the database. :)
 
Hi. If a db file is not trusted yet, its code are disabled. If that's the case, any code to enable content or make the file trusted also won't run to do its job. Sorry.
 
Last edited:
Following on from @theDBguys comments, the best workaround is to distribute your file using a professional installer application and include a script which makes the file trusted before it is first opened. Doing that will ensure that any startup macros or code will run successfully
 
Hi. If a db file is not trusted yet, its code are disabled. If that's the case, any code to enable content or make the file trusted also won't run to do its job. Sorry.
I'm not disagreeing with the point you're making, within Access anyway, but I feel that the OP might accidentally misinterpret it, stated just so as it is, so am adding this for context:

The OP might interpret it to mean that there is no automated way to make the file trusted, which is not true. VBScript is the most common way of using the 'editing the registry' method.
 
I'm not disagreeing with the point you're making, within Access anyway, but I feel that the OP might accidentally misinterpret it, stated just so as it is, so am adding this for context:

The OP might interpret it to mean that there is no automated way to make the file trusted, which is not true. VBScript is the most common way of using the 'editing the registry' method.
Hi @Isaac. That's a fair point. I was just reacting to the OP's first statement.
is there any code that can enable macro ++auto++ when applications start
It was the "when application start" part that got my attention. Cheers!
 

Users who are viewing this thread

Back
Top Bottom