VB.Net - TypeName

This function returns a string containing the name of the data type that is stored in a variable.

Dim sMyType As String 
Dim sStringVar As String
Dim iIntegerVar As Integer

sMyType = Microsoft.VisualBasic.Information.TypeName(sStringVar) ' Returns "String".
sMyType = Microsoft.VisualBasic.Information.TypeName(iIntegerVar) ' Returns "Integer".

C# Equivalent

The equivalent in C# is to use the object.GetType() method.


This function is available in VBA

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext