Function Convert Values Class

VariantToString

Converts any type of Variant into a string. Null and Empty is converted to a zero-length string.

Signature (Visual Basic / VBA)

Public Function VariantToString( _
    ByVal vValue As Variant _
    ) As String

Code Example

    VariantToString(Null) = ""
    VariantToString(EmptyValue) = ""
    VariantToString("Word") = "Word"
    VariantToString(123456) = "123456"

Parameters

Parameter Description
vValue The value which is to be converted to a string. Function returns an empty string if vValue is Null or Empty. Function generates an error when passed things like object pointers which have no string representation.