Syntax

expression.UserControl

expression A variable that represents an Application object.

Remarks

When the UserControl property is False for an object, that object is released when the last programmatic reference to the object is released. If this property is False, Microsoft Excel quits when the last object in the session is released.

Example

This example displays the status of the UserControl property.

Visual Basic for Applications
If Application.UserControl Then MsgBox "This workbook was created by the user" Else MsgBox "This workbook was created programmatically" End If 
Find out if the workbook was created or started by end user? user user control User Control Property usercontrol usercontrol property Was this workbook opened by the vba code?

See also: