Function Convert Values Class

CVarIgnErr

"Convert To Variant Ignore Errors" Attempt to convert vValue to a Variant (either string or numeric) value. Return vValue as a Variant value if the conversion was successful. Return Empty if vValue could not be converted to a Variant.

Signature (Visual Basic / VBA)

Public Function CVarIgnErr( _
    ByVal vValue As Variant _
    ) As Variant

Code Example

    CVarIgnErr(34) = 34
    CVarIgnErr("Word") = "Word"
    IsEmpty(CVarIgnErr(Nothing)) = True

Parameters

Parameter Description
vValue The value which will be converted to a Variant and returned (if conversion is possible). Conversion is not possible if vValue is Null, an Error, or an Object.