简体   繁体   中英

Is there Any way to change the colour of an Excel Cell using C#?

I am working on an ASP project where I need to Change the color of the cells based on some validation Checks and return it to user.

Currently I have successfully Implemented this functionality using Excel 12.0 Object Library. But the problem is that I need to improve performance. InterOp library is very slower than what I expected.

Is there any way that I can Format the cells on an Excel sheet without using InterOp library. (Something like connecting using OleDb connection and formatting) ??

Please Share Your Knowledge

Try using ExcelPlusPlus library from codeplex. It is not using OleDB

EPPlus link

From codeplex:

Create advanced Excel 2007/2010 spreadsheets on the server

EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx). 


EPPlus supports:

Cell Ranges 
Cell styling (Border, Color, Fill, Font, Number, Alignments)
Charts
Pictures
Shapes
Comments
Tables
Protection
Encryption
Pivot tables
Data validation
Conditional formatting
VBA
Many more...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM