Application_Startup not doing its thing

Cara

Senior Member
Outlook version
Outlook 2021 64 bit
Email Account
IMAP
Operating system::    Windows 10
Outlook version:     Pro Plus 2021
Email type or host:    IMAP

I have the following in the ThisOutlookSession module:
Private Sub Application_Startup()
Application.ActiveExplorer.WindowState = olMaximized
Application.ActiveExplorer.ShowPane olFolderList, True
Application.ActiveExplorer.ShowPane olOutlookBar, False
Application.ActiveExplorer.ShowPane olPreview, False
Application.ActiveExplorer.ShowPane olNavigationPane, True
End Sub


It's starting up maximized but I'm not sure that's due to this script. It's not turning on the folder list, which is the main thing I'm wanting it to do.

Macro security is fine - I run tons of VBA scripts in Outlook.

What could be causing this to just not run?
 
What could be causing this to just not run?
Application_Startup may be running before the Explorer Window is fully initialized. To test, try running the sub steps manually after Outlook has had a chance to finish all of it's initial setup.
 
Application_Startup may be running before the Explorer Window is fully initialized. To test, try running the sub steps manually after Outlook has had a chance to finish all of it's initial setup.
Running the sub manually after Excel loads works fine. How do I get application_startup to wait for the window to be initialized, then run?
 
Running the sub manually after Excel loads works fine. How do I get application_startup to wait for the window to be initialized, then run?
I can't reproduce any race condition. On my PC your original code executes OK and I get a Maximized Explorer Window with a Folder List Nav Pane visible. Not sure why we are getting different results.

Just to be sure that your Application_Startup Sub is running, put a VBA Stop as the first line of your sub. This should break out into the Debugger.
Stop statement (VBA)
 
Similar threads
Thread starter Title Forum Replies Date
G Error - "Customized functionality in this application will not work because the certificate" Outlook VBA and Custom Forms 1
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
bmtjedi Set objApp = Application Not Working in O365-32bit Using Outlook 1
avant-guvnor Outlook.Application now produces error Outlook VBA and Custom Forms 5
C Custom Application Form send Email to Another User Using Outlook 1
N Select Existing BCM Business Contact in C# application Using Outlook 0
S Using "start application" rule action Using Outlook 2
smokiibear windows security mail application not accepting username and password Using Outlook 0
Y VBA - Application Filedialog Hidden Behind Outlook Using Outlook 0
T Synchronize outlook appointments through web application. Using Outlook 1
O Outlook 2010 Stops Working When Accounting Application Tries To Send eMail Using Outlook 4
C MAPI to access a 64 bit Outlook from a 32 bit application; or access via ODBC Using Outlook 0
K Handling application.quit event Outlook VBA and Custom Forms 8
M VSTO C#: How do I declare an application scope variable? Outlook VBA and Custom Forms 2
E Turn application visibility off Outlook VBA and Custom Forms 2
T Run application from cmd button Outlook VBA and Custom Forms 5
D Outlook 2007 Will Not Send Mail From C# Application Outlook VBA and Custom Forms 7
P Supporting threads in Outlook VBA application Outlook VBA and Custom Forms 1
R vba instantiated internetExplorer.application differs from user la Outlook VBA and Custom Forms 1
K How to disconnect Application.COMAddIns.Item().Object? Outlook VBA and Custom Forms 4
D outlook.exe application error - breakpoint has been reached. fix? BCM (Business Contact Manager) 1
P Drag and Drop mails from Outlook to Clarion6 Application Outlook VBA and Custom Forms 5
J Office application does not match advisory. Why? BCM (Business Contact Manager) 3
D Application.ActiveInspector() is Null on Ribbon Load Outlook VBA and Custom Forms 1
D Application.ActiveInspector().CurrentItem Returns Wrong(Old) Value Outlook VBA and Custom Forms 3
L RE: BCM Office Application Issue BCM (Business Contact Manager) 1
R Can calendar be displayed in another Office application? Outlook VBA and Custom Forms 1
D Office 365 Outlook desktop app prompts for all account passwords on startup Using Outlook 11
N Outlook 365 How to show all calendars at startup? Outlook VBA and Custom Forms 0
A Imap account not auto syncing inbox at startup Using Outlook 0
V macro runs slower on startup than after Outlook VBA and Custom Forms 3
W Outlook 2010 Reading Pane Slows Startup Using Outlook 3
D Outlook 2016: /altvba startup switch does not work Using Outlook 2
O VBA to Run Font Change on Outlook Startup Outlook VBA and Custom Forms 4
S Choose-outlook-startup-folder with VBA Outlook VBA and Custom Forms 6
EricW Outlook 2013 Startup Failures Using Outlook 15
Sarge USMC troubleshooting slow startup Using Outlook 6
I Outlook 03 slow startup Using Outlook 5
P Outlook 2010 will not receive on startup Using Outlook 0
B Initial "Connecting" to public folders on startup Using Outlook 8
C Outlook 2003 - error on startup Using Outlook 3
C RE: Error message on startup BCM (Business Contact Manager) 1
K Startup option Outlook VBA and Custom Forms 1
R How do I turn off the Business Contact Manager startup in Outlook BCM (Business Contact Manager) 1
F How resolve critical error during startup of Business Contact Mgr BCM (Business Contact Manager) 2
E outlook 2007 startup wizard keeps opening Using Outlook 2
W Outlook is doing my head in just to login to it Using Outlook 5
S Restrict method question on email. What am I doing wrong? Outlook VBA and Custom Forms 2

Similar threads

Back
Top