?
Solved

Can I Create Cell Borders In Excel Using Late Binding

Posted on 2011-10-21
2
Medium Priority
?
489 Views
Last Modified: 2012-05-12
I want to put thin borders around certain cells in Excel, but I don't want the aggravation of using early binding.

Is there a way to do this?
0
Comment
Question by:Buck_Beasom
2 Comments
 
LVL 7

Expert Comment

by:shaydie
ID: 37008011
Yes, Something like this:

       With oSheet.Range("B3:K7").Borders(7) ' xlEdgeLeft
        .LineStyle = 1 ' xlContinuous
        .Weight = 2 'xlThin
        .ColorIndex = -4105 'xlAutomatic
        End With
       
        With oSheet.Range("B3:K7").Borders(8) ' xlEdgeTop
        .LineStyle = 1 ' xlContinuous
        .Weight = 2 'xlThin
        .ColorIndex = -4105 'xlAutomatic
        End With
       
        With oSheet.Range("B3:K7").Borders(9) ' xlEdgeBottom
        .LineStyle = 1 ' xlContinuous
        .Weight = -4138 'xlMedium
        .ColorIndex = -4105 'xlAutomatic
        End With
       
        With oSheet.Range("B3:K7").Borders(10) ' xlEdgeRight
        .LineStyle = 1 ' xlContinuous
        .Weight = 2 'xlThin
        .ColorIndex = -4105 'xlAutomatic
        End With
0
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 37009068
Check my FAQ code:
http://www.eggheadcafe.com/sample-code/MicrosoftExcel/ff8027d8-861a-40d5-8e3b-fe54571e2876/how-to-draw-and-clear-a-border-around-a-cell-or-range-of-cells.aspx

Note: It does take a range as paremeter, thus your late binding code must provide this range. For late binding check late binding section of:
http://support.microsoft.com/kb/302902
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question