Application Class

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
Using Object browser, Application class has the following:

Activecell as range
Activechart as chart
Activesheet as object
Activeworkbook as workbook
ActiveWindow as winodw

All of them make sense to me except ActiveSheet? Why is define as Object? What does that mean? Why they did not define it as

ActiveSheet as Sheet

Thank you.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
ActiveSheet could be a Worksheet object or it could be a Chart object.
Don't know why they prefered Object to Sheet.
 
Upvote 0
Why they did not define it as

ActiveSheet as Sheet
Because "Sheet" is not a data type that variables can be declared as. If you type this...

"Dim SomeVariable As"

into the module's code window, when you type a space character after the "As" keyword, there will be no item in the list of data types named "Sheet". There are "Sheet1", "Sheet2", etc. which are specific sheets, but there is no general "Sheet" item (the item is Worksheet, but that is a specific type of sheet, not a general sheet covering worksheets, charts, etc.).
 
Upvote 0

Forum statistics

Threads
1,224,749
Messages
6,180,727
Members
452,995
Latest member
isldboy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top