Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
i want to excell heading

rows get bold style
Posted
Comments
Suresh Suthar 20-Dec-11 1:24am    
At least you should ask a detailed question. We don't know what you want to do or what you have done so far?
And please do some Google search before posting a questions on CP.

As far as I know, you can manipulate the data in an Excel file using OleDb, but not format it.

Few options that come in mind:
- use Interop, see: http://msdn.microsoft.com/en-us/library/ms173186(v=vs.80).aspx[^]
- use templates for the excel file, see: http://office.microsoft.com/en-us/excel-help/create-and-maintain-excel-templates-HA001054814.aspx[^]
- do the formatting on Excel side using macros
 
Share this answer
 
Here is one solution :

C#
var eApp = new Excel.Application { DisplayAlerts = false };
eApp.Workbooks.Open(@"c:\target.xlsx");
eApp.Visible = true;
Worksheet ws = eApp.ActiveSheet;
Range r =  ws.Rows[1];
r.Font.Bold = true;


This will make first row bold.

Hope it helps.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900