Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.38 KB

load-statement.md

File metadata and controls

53 lines (37 loc) · 1.38 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
Load statement (VBA)
vblr6.chm1100680
vblr6.chm1100680
58e13f8f-3a3b-99d1-bf05-575ddf42c7c7
12/03/2018
medium

Load statement

Loads an object but doesn't show it.

Syntax

Load object

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

When an object is loaded, it is placed in memory, but isn't visible. Use the Show method to make the object visible. Until an object is visible, a user can't interact with it. The object can be manipulated programmatically in its Initialize event procedure.

Example

In the following example, UserForm2 is loaded during UserForm1's Initialize event. Subsequent clicking on UserForm2 reveals UserForm1.

' This is the Initialize event procedure for UserForm1 
Private Sub UserForm_Initialize() 
 Load UserForm2 
 UserForm2.Show 
End Sub 
' This is the Click event of UserForm2 
Private Sub UserForm_Click() 
 UserForm2.Hide 
End Sub 
 
' This is the click event for UserForm1 
Private Sub UserForm_Click() 
 UserForm2.Show 
End Sub

See also

[!includeSupport and feedback]