How to suppress auto macros AND the auto-start form's Form_Load or Form_Activate

jasmith4

Active Member
Joined
May 16, 2008
Messages
337
I know that if a database has an Auto_Exec macro, and you open in programmatically, you can suppress Auto_Exec by setting Application.AutomationSecurity = msoAutomationSecurityForceDisable first:
Code:
        [B]AccessApp.AutomationSecurity = msoAutomationSecurityForceDisable[/B]
        AccessApp.OpenCurrentDatabase MyDatabase$
But if it has a startup form (like Switchboard), and that form has a Form_Load or similar event, the form starts up anyway, and the event's code is run. Shouldn't that startup form and/or all its code be suppressed too? If not, how do you suppress it?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I don't know if you are looking for a temporary solution so that you can tinker with the database but if you hold down the shift key while opening the file that will disable any start up forms...
 
Upvote 0
I think I just found it: the setting of AutomationSecurity has no effect if in Trust Center Settings / Macro Options you choose Enable all macros.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top