簡體   English   中英

有沒有辦法使用C#更改Excel單元格的顏色?

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

我正在開發一個ASP項目,我需要根據一些驗證檢查更改單元格的顏色並將其返回給用戶。

目前,我已使用Excel 12.0對象庫成功實現了此功能。 但問題是我需要提高性能。 InterOp庫比我預期的要慢。

有沒有辦法可以在不使用InterOp庫的情況下在Excel工作表上格式化單元格。 (像使用OleDb連接和格式化連接的東西)?

請分享您的知識

嘗試使用codeplex中的ExcelPlusPlus庫。 它沒有使用OleDB

EPPlus鏈接

來自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...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM