User`s guide

Modifying F lags
Dim aClass As mycomponent.myclass
Dim var1, var2 As Variant
Dim y As Variant
On Error Goto Handle_Error
var1 = 1
var2 = 2#
Set aClass = New mycomponent.myclass
Call aClass.foo(1,y,var1,var2)
Exit Sub
Handle_Error:
MsgBox(Err.Description)
End Sub
This example converts var1 of type Variant/Integer to an int16 and var2 of
type
Variant/Double to a double.
If the original MATLAB function expects
doubles for both arguments, this
code might cause an error. Onesolutionistoassigna
double to var1,butthis
may not be possible or desirable. In such a case set the
CoerceNumericToType
flag to mwTypeDouble, causing the data converter to co nv ert all numeric input
to
double. In the previous example, place the following line after creating the
class and before calling the methods:
aClass .MWFlags.DataConversionFlags.CoerceNumericToType =
mwTypeDouble
The InputDateFormat flag controls how the VBA Date type is converted.
This example sends the current date and time as an input argument and
converts it to a string:
Sub foo( )
Dim aClass As mycomponent.myclass
Dim today As Date
Dim y As Variant
On Error Goto Handle_Error
today = Now
Set aClass = New mycomponent.myclass
aClass. MWFlags.DataConversionFlags.InputDateFormat =
2-17