Interface IStdGlobalClass
MS-VBAL 6.1.3.3 Global Class: the subroutines that load and unload a form.
[StdLibModule("Global")]
public interface IStdGlobalClass
Remarks
VBA's Global is an application object: its members resolve unqualified, as a standard module's do (Unload Me), which is how it is declared here.
What a form is, and what loading and unloading it does, is the form host's: the Microsoft Forms compatibility layer, on Windows, which implements these. A platform with no form host has no form to load, and says so when one is.
Methods
Load(VBObjectValue)
MS-VBAL 6.1.3.3.1.1 Load Loads a form without showing it.
RuntimeSemanticsEvaluationResult Load(VBObjectValue @object)
Parameters
objectVBObjectValueThe form.
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Any reference to a form loads it (a UserForm's Initialize runs then), so the argument has loaded it by the time this is called: what is left is to
say that an object that is no form cannot be loaded (error 361).
Unload(VBObjectValue)
MS-VBAL 6.1.3.3.1.2 Unload Unloads a form.
RuntimeSemanticsEvaluationResult Unload(VBObjectValue @object)
Parameters
objectVBObjectValueThe form.
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
A UserForm is asked first (QueryClose, with vbFormCode), and stays loaded when it cancels; otherwise its Terminate runs, its window is
destroyed, and a default instance is let go of, so that the next reference to it loads another (Excel-measured, oracle\s41).
UserForms()
The forms that are loaded, in the order they were (IStdUserFormsClass).
[StdLibMember(null, Kind = StdLibMemberKind.PropertyGet)]
RuntimeSemanticsEvaluationResult<VBObjectValue> UserForms()
Returns
Remarks
Declared As Object, as MS-VBA declares it: its members are late-bound, and what they are is the collection's, not any interface's a program could
name. It is the same object every time (Excel-measured, oracle\s41 U01, U02).