View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Late Binding examples of binding excel application


"HeatherO" wrote in message
...
Thanks Bob.
Sorry it posted twice I had a problem when I posted the first time it said
it didn't post and apparently it did so sorry for the double post.


No problem, it doesn't bother me too much, but it is considered bad form. I
did include a smiley :-)

I think I
am getting the idea of it. vlookup is a method but cells,ranges and
worksheets are objects and need to be defined at the beginning, am I

right??

Not quite. You are correct about the objects (but see comments later), but
VLOOKUP is a worksheetfunction that VBA has access to via the Application
object, and the WorksheetFunction property. Range("range").Clear is an
example of a method, something that acts upon, or does something to an
object.

Not necessarily true that you need to define at the beginning. Actually,
neither point is true, but preferred in my view. You don't have to declare
variables, but if you don't that will be Variant type variables, which will
cast to Object sub-types when used (but they could cast to other types in
another circumstance, yuk!). Also, you don't need to do it at the beginning,
just before you use it. As I say, I prefer to declare and at the beginning,
and I add Option Explicit to my code, to force me to declare, saves tears
later.

I'm not sure about cells I don't think they are an object but you can

correct
me if I am wrong.


Ah, the interesting one. Cells are not an object, you are correct, they are
a property, applying tgo the Application, Worksheet or Range object.
Interestingly, Range can be an object, or a property of the Application,
Worksheet or Range object! Good eh. There is a test next week :-)

More programming, oh well. I think I asked you about this earlier and I
thought I could get away without it. I guess I proved myself wrong.


That's the fun part :-)

I really appreciate your help. I hope Microsoft gives you something for

all
your help, it's much appreciated.


No, I do it for the love (and because I am a sad old git, like many others
here :-)). Did you check that web page I gave you?

Regards Bob