View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
HeatherO HeatherO is offline
external usenet poster
 
Posts: 41
Default Late Binding examples of binding excel application

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. 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??
I'm not sure about cells I don't think they are an object but you can correct
me if I am wrong.

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. I
really appreciate your help. I hope Microsoft gives you something for all
your help, it's much appreciated.

Heather

"Bob Phillips" wrote:

Heather,

The stuff you refer to is not relevant as they are object within the Excel
application, and the late binding will define an Excel app variable. Just
make sure that you don't type any variables as Excel object types. So it
would look something like

Dim xlApp As Object
Dim thisWb As Object 'not Workbook
Dim thisWs As Object 'not Worksheet
Dom rng As Object 'not Range

Set xlApp = CreateObject("Excel.Application")
Set thisWb = xlApp.Workbooks.Open("C:\mytest.xls")
Set thisWs = thisWb.Worksheets(1)
Set rng= thisWs.Range("A1:H10"

Msgbox xlApp.VLOOKUP(thisWs.Range("L1"),rng,2,FALSE)

etc.

You might also find this webpage helpful

http://www.xldynamic.com/source/xld.EarlyLate.html
Develop Early, Release Late

--

HTH

RP
(remove nothere from the email address if mailing direct)


"HeatherO" wrote in message
...
Does anyone have any examples of code that does late binding with excel?
I am a visual person I need to see an example of it. Preferably to where
they are doing active sheet and vlookups or cell stuff. Or just anything.
I've seen it for other applications and I am just trying to understand how

to
do it for excel. Is it that for every object I see in the object library

for
excel I have to now create an object referring to those objects??
Thanks in advance for any help, too bad I couldn't just use that reference
to that library my macro runs so well with that.
Heather