VBA Excel Objects
VBA Excel Objects
When programming using VBA, there are few important objects that a user would be dealing with.
Application Objects
Workbook Objects
Worksheet Objects
Range Objects
Application Objects
The Application object consists of the following −
Example
'Example 1 :
Set xlapp = CreateObject("Excel.Sheet")
xlapp.Application.Workbooks.Open "C:\test.xls"
'Example 2 :
Application.Windows("test.xls").Activate
'Example 3:
Application.ActiveCell.Font.Bold = True
Workbook Objects
The Workbook object is a member of the Workbooks collection and contains all the Workbook objects currently
open in Microsoft Excel.
Example
https://www.tutorialspoint.com/cgi-bin/printpage.cgi 1/2
7/12/2017 VBA Excel Objects
Worksheet Objects
The Worksheet object is a member of the Worksheets collection and contains all the Worksheet objects in a
workbook.
Example
Range Objects
Range Objects represent a cell, a row, a column, or a selection of cells containing one or more continuous blocks
of cells.
https://www.tutorialspoint.com/cgi-bin/printpage.cgi 2/2