VBA Object Data Type in Excel

Object Data Type in Excel VBA

Object Data Type in Excel VBA explained with syntax and examples. An object consists of reference to an object. It occupies 4 bytes (32 bits) in memory. We use Set statement for a convenient way to refer an object.

Data Type Object Syntax in Excel VBA

Let us see Data Type Object Syntax in Excel VBA.

Dim VariableName as Object

Where VariableName represents the name of the variable.
and Object represents the type of data.

Example on the Data Type Object in Excel VBA

Here is an example on the Data Type Object in Excel VBA.

Sub VBAF1_Object_DataType()
    
    'Integer Variable Declaration
    Dim wWorkbook As Object
       
    Set wWorkbook = Workbooks.Add
     
End Sub

VBA Data Types

Also read about all other data types.

VBA Data Types

Leave a Comment

Your email address will not be published. Required fields are marked *