Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
in excel mutiple cells to be in border style.
 
my code as follows;
 

chartRange = xlWorkSheet.get_Range("A" + xlRow, "A" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("B" + xlRow, "B" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("C" + xlRow, "C" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("D" + xlRow, "D" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     chartRange = xlWorkSheet.get_Range("E" + xlRow, "E" + xlRow);
                     chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
                     xlRow = xlRow + 1;
 
when i type the above code output as follows;
 
AFF
Date Session1 Session2 Session3 Session4
14/1/2013 cm rk vk
15//2013 MK Rj GS
16/1/2013 RK CM VK.
 

from the output the border is coming only for as follows;
 

14/1/2013 cm rk vk
15//2013 MK Rj GS
16/1/2013 RK CM VK
 
Border is not coming for as follows;
 
AFF
Date Session1 Session2 Session3 Session4
 

i want the border to come for the above two lines.how can i do,help me.
 
from my above code wat changes are required.
Posted 22-Jan-13 0:01am
(unknown member)
Edited 22-Jan-13 0:06am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 BillWoodruff 173
3 Sergey Alexandrovich Kryukov 170
4 PIEBALDconsult 160
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100