User`s guide

D Utility Library
D-4
Return Value. None.
Remarks. This function must be called once for each session of Excel that uses
Excel Builder components. An error is generated if a method call is made to a
member class of any Excel Builder component, and the library has not been
initialized.
Example. This Visual Basic sample initializes the MWComUtil library with the
current instance of Excel. A global variable of type
Object named MCLUtil
holds an instance of the
MWUtil class, and another global variable of type
Boolean named bModuleInitialized stores the status of the initialization
process. The private subroutine
InitModule() creates an instance of the
MWComUtil class and calls the MWInitApplication method with an argument of
Application. Once this function succeeds, all subsequent calls exit without
recreating the object.
Dim MCLUtil As Object
Dim bModuleInitialized As Boolean
Private Sub InitModule()
If Not bModuleInitialized Then
On Error GoTo Handle_Error
If MCLUtil Is Nothing Then
Set MCLUtil = CreateObject("MWComUtil.MWUtil")
End If
Call MCLUtil.MWInitApplication(Application)
bModuleInitialized = True
Exit Sub
Handle_Error:
bModuleInitialized = False
End If
End Sub
Sub MWPack(pVarArg, [Var0], [Var1], … ,[Var31])
Packs a variable length list of Variant arguments into a single Variant array.
This function is typically used for creating a
varargin cell from a list of
separate inputs. Each input in the list is added to the array only if it is
nonempty and nonmissing. (In Visual Basic, a missing parameter is denoted by
a
Variant type of vbError with a value of &H80020004.)