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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

igold

Well-known Member
Joined
Jul 8, 2014
Messages
2,854
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,148
Messages
5,835,678
Members
430,374
Latest member
PeteBrown

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