Excel automation - Borders

Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
edited 2002-12-20 in Navision Attain
I want to set a border in Excel using automation. I know the BorderAround method wich works if you want a full border.

But now I just need a vertical line, so I need the Borders-property.

This is some VB Code:
With Worksheets("Sheet1").Range("B2").Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 3
    End With

How to code this in Navision? The problem is: how to set xlEdgeRight (= 10)?
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)

Comments

  • Morten_SolbergMorten_Solberg Member Posts: 24
    Hi, try this code:

    xlRange := xlWorksheet.Range('B2');
    xlRange.Borders.Item(10).LineStyle(1); //Const xlEdgeRight = 10 //Const xlContinuous = 1
    xlRange.Borders.Item(10).Color := 255; //red
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Thx mate!

    Works fine.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Sign In or Register to comment.