SyntaxDim result As Object = CObj (expression)
DescriptionThe CObj function converts any expression that can be interpreted as an object to the Object data type. Usage at a Glance
ExampleThe following code stores strongly typed data as an Object: Dim strongData As New SomeClass Dim weakData As Object weakData = CObj(strongData) Version DifferencesThe CObj function did not exist in VB 6. The closest equivalent in VB 6 was CVar, which converted a data type to a Variant. |