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?
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

igold

Well-known Member
Joined
Jul 8, 2014
Messages
2,506
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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...
 

jasmith4

Active Member
Joined
May 16, 2008
Messages
337
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,509
Messages
5,596,561
Members
414,077
Latest member
ammylar5

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
Top