ModuleLoad Function

Syntax

ModuleLoad(ModuleName$, CreateNew)

Group

Flow Control

Description

Load a module. Does not execute the module. Macro's can not be loaded. Returns an object if successful, otherwise Nothing is returned.

Sandbox

Sandbox mode may block this function.

Parameters

Parameters Description
ModuleName$ Load the module named by this string value.
CreateNew Return a new instance if True. Otherwise return the default instance. A class module does not have a default instance. A code module can not have a new instance.

Example


Sub Main
    Dim Obj As Object
    Set Obj = ModuleLoad("Demo")
    Obj.DoIt ' call Demo's DoIt method
End Sub

See also

MacroCheck, MacroCheckThis, MacroRun, MacroRunThis, ModuleLoadThis