User`s guide

2 Programming with MATLAB Builder for Excel
mwDateFormatString
Call aClass.foo(1,y,today)
Exit Sub
Handle_Error:
MsgBox(Err.Description)
End Sub
The n ext example uses an MWArg object to m odify the conversion flags for
one argument in a method call. In thi s case the first output argument (
y1)
is coerced to a
Date, and the second output argument (y2) uses the current
default conversion flags supplied by
aClass.
Sub foo(y1 As Variant, y2 As Variant)
Dim aClass As mycomponent.myclass
Dim ytemp As MWArg
Dim today As Date
On Error Goto Handle_Error
today = Now
Set aClass = New mycomponent.myclass
Set y1 = New MWArg
y1.MWFlags.DataConversionFlags.OutputAsDate = True
Call aClass.foo(2, ytemp, y2, today)
y1 = ytemp.Value
Exit Sub
Handle_Error:
MsgBox(Err.Description)
End Sub
2-18