Question about late bindings in excel

  • Thread starter Thread starter Ingman
  • Start date Start date
I

Ingman

Hi all,

This is a "noobish" question, but here it goes. Im using late bindings in
excel in order to avoid version problem. But if i want to change for example
the top border of a cell how do i do this? If I use the following:

objWs.Cells(1,1).Borders(xlEdgeBottom) the system doesnt recognize
xlEdgeBottom since i dont have any reference to it. Im guessing theres a
object creation im missing, any ideas would be really appreciated.

Best Regards,
 
You have to either declare the constant yourself:

Const xlEdgeBottom As Long = 9

or else use the value in your expression:

objWs.Cells(1,1).Borders(9)

There's really no other option when using late binding.
 
Douglas J. Steele said:
or else use the value in your expression:
objWs.Cells(1,1).Borders(9)

And if I was to do the above I'd add a note stating that 9 =
xlEdgeBottom. A day later and I'd never remember what 9 meant.
<smile>

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Tony Toews said:
And if I was to do the above I'd add a note stating that 9 =
xlEdgeBottom. A day later and I'd never remember what 9 meant.
<smile>

Definitely! That's why I usually define the constants myself (in a common
module so that they're usable anywhere in the application)
 
Back
Top