Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
xlRow = xlRow + 1;
                   xlWorkSheet.Cells[xlRow, 1] = "Date";
                   xlWorkSheet.Cells[xlRow, 2] = "Session1 ";
                   xlWorkSheet.Cells[xlRow, 3] = "Session2 ";
                   xlWorkSheet.Cells[xlRow, 4] = "Session3 ";
                   xlWorkSheet.Cells[xlRow, 5] = "Session 4";
                   xlRow = xlRow + 1;
then i excel as follwos teh above code
 

Date Session1 Session2 Session3 Session4
 

the above code is working. i want the Date Session1 Session2 Session3 Session4
 
in BOLD Letter how can i do from my code wat to do.
Posted 21-Jan-13 22:42pm
Edited 21-Jan-13 23:14pm
v2
Comments
Abhinav S at 22-Jan-13 4:45am
   
Your question is already available at http://www.codeproject.com/Questions/532226/inplusexcelplushowplustoplussetplusthepluscellplus. Kindly don't repost.
lukeer at 22-Jan-13 5:40am
   
Plus you got an answer there. If that doesn't work, please comment on the given solution so the poster knows it didn't work in this case.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

oSheet.get_Range("A1", "D1").Font.Bold = true;
        oSheet.get_Range("A1", "D1").VerticalAlignment =
            Excel.XlVAlign.xlVAlignCenter;
 
u can refer
http://support.microsoft.com/kb/302084[^]
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

xlWorkSheet.get_Range("A1", "D1").Font.Bold = true;
xlWorkSheet.get_Range("A1", "D1").Font.Color = Color.Blue;
xlWorkSheet.get_Range("A1", "D1").Borders.Color = Color.Violet;
xlWorkSheet.get_Range("A1", "D1").Borders.LineStyle = XlLineStyle.xlContinuous;
xlWorkSheet.get_Range("A1", "D1").Borders.Weight = Microsoft.Office.Interop.Excel.XlBorderWeight.xlMedium;
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 540
1 OriginalGriff 300
2 CPallini 290
3 ChauhanAjay 124
4 George Jonsson 120
0 OriginalGriff 6,474
1 Sergey Alexandrovich Kryukov 6,190
2 CPallini 5,180
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.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