Link to home
Create AccountLog in
Avatar of KenHadley
KenHadleyFlag for United States of America

asked on

Difference between Excel Object Property and Method

In trying to understand the Excel Object Model, I wonder why the terms Method and Property are used inconsistently. I have some experience in the Java world, where the Property of an object is always what something *is*, while a Method is always something the object *does* (or is done to it).

This obviously occurs in the Excel Object Model as well, but sometimes I get surprised. For example, there is a Resize method for a ListObject object. Makes perfect sense. However, the Range object has a *Property* called Resize that appears to *do* the exact same thing. Why would this be called Property in the model. Am I missing something?
Avatar of no worries :-) no nothing
no worries :-) no nothing
Flag of Greece image


ListObject.Range is read only and represents the range to which the ListObject applies

ListObject.Resize enables the ListObject  to be resized over a new range

Avatar of Patrick Matthews
KenHadley,

Resize is redefining what the Range object is, so on that basis at least I guess you could say it meets your definition of a property.

:)

Patrick
SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of KenHadley

ASKER

Thank you for the responses. The inconsistency in the OM is unfortunate, but as long as I know I am not missing something important in the OM, we can make it work.