none
How to set border using excel automation ?

    Question

  • Hi all,

    How i can set border line (All borders) for my data using excel automation ?

    Thanks,

    Yanyee.


    MCP - SQL SERVER 2k/ WINDOWS XP , PROGRAMMER ANALYST

    Wednesday, July 03, 2013 8:18 AM

Answers

    • Edited by Pavel CelbaModerator Wednesday, July 03, 2013 4:10 PM one more link
    • Marked as answer by yanyee Friday, July 05, 2013 1:50 AM
    Wednesday, July 03, 2013 4:09 PM
  •   WITH lo_ActiveSheet.Range("A2:A2") AS EXCEL.Range
        WITH .Borders(8) AS EXCEL.Borders && Top
          .LineStyle = 1 && Continuous line
          .Weight =  4 && Thick (widest border). 
        ENDWITH
      
        WITH .Borders(9) AS EXCEL.Borders && Bottom
          .LineStyle = 1 && Continuous line
          .Weight =  4 && Thick (widest border). 
        ENDWITH
      ENDWITH
    
      *-- Set left border for column A
      WITH lo_ActiveSheet.Range("A2").Borders(7) AS EXCEL.Borders
        .LineStyle = 1 && Continuous line
        .Weight =  4 && Thick (widest border). 
      ENDWITH
    
      *-- Set right border for column A
    *!*	  WITH lo_ActiveSheet.Range("A2").Borders(10) AS EXCEL.Borders
      WITH lo_ActiveSheet.Range("A2:A2").Borders(10) AS EXCEL.Range
        .LineStyle = 1 && Continuous line
        .Weight =  4 && Thick (widest border). 
      ENDWITH


    • Edited by Benny GabelEditor Wednesday, July 03, 2013 4:17 PM change column in code
    • Marked as answer by yanyee Friday, July 05, 2013 1:50 AM
    Wednesday, July 03, 2013 4:16 PM

All replies

    • Edited by Pavel CelbaModerator Wednesday, July 03, 2013 4:10 PM one more link
    • Marked as answer by yanyee Friday, July 05, 2013 1:50 AM
    Wednesday, July 03, 2013 4:09 PM
  •   WITH lo_ActiveSheet.Range("A2:A2") AS EXCEL.Range
        WITH .Borders(8) AS EXCEL.Borders && Top
          .LineStyle = 1 && Continuous line
          .Weight =  4 && Thick (widest border). 
        ENDWITH
      
        WITH .Borders(9) AS EXCEL.Borders && Bottom
          .LineStyle = 1 && Continuous line
          .Weight =  4 && Thick (widest border). 
        ENDWITH
      ENDWITH
    
      *-- Set left border for column A
      WITH lo_ActiveSheet.Range("A2").Borders(7) AS EXCEL.Borders
        .LineStyle = 1 && Continuous line
        .Weight =  4 && Thick (widest border). 
      ENDWITH
    
      *-- Set right border for column A
    *!*	  WITH lo_ActiveSheet.Range("A2").Borders(10) AS EXCEL.Borders
      WITH lo_ActiveSheet.Range("A2:A2").Borders(10) AS EXCEL.Range
        .LineStyle = 1 && Continuous line
        .Weight =  4 && Thick (widest border). 
      ENDWITH


    • Edited by Benny GabelEditor Wednesday, July 03, 2013 4:17 PM change column in code
    • Marked as answer by yanyee Friday, July 05, 2013 1:50 AM
    Wednesday, July 03, 2013 4:16 PM
  • Hi Benny and Pavel,

    Thanks so much for links and code. :P


    MCP - SQL SERVER 2k/ WINDOWS XP , PROGRAMMER ANALYST

    Friday, July 05, 2013 1:50 AM