devxlogo

The StartMode Property Of The App Object

The StartMode Property Of The App Object

The StartMode setting in the Options dialog of the Tools menu in VB4determines only whether an application with no startup form continues torun after Sub Main has completed. This allows testing of OLE Automationservers. But the StartMode property of the App object allows you to determinein code whether an application shows any visible interface to users. Asingle VB executable file can be both an invisible server and a normalapplication, just like Excel. The Sub Main procedure lets you test thevalue of App.StartMode to decide whether or not to show a form. If theapplication is started directly by a user, the StartMode is vbSModeStandalone.If started by a client application, the StartMode is vbSModeAutomation.

 Sub Main	If App.StartMode = vbSModeStandalone Then		frmMain.Show	Else		'OLE server action...	End If
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist