c# - 有没有办法使用 C# 更改 Excel 单元格的颜色?

标签 c# asp.net excel oledb office-interop

我正在开发一个 ASP 项目,我需要根据一些验证检查更改单元格的颜色并将其返回给用户。

目前我已经使用 Excel 12.0 对象库成功实现了这个功能。
但问题是我需要提高性能。 InterOp 库比我预期的要慢得多。

有什么方法可以在不使用 InterOp 库的情况下格式化 Excel 工作表上的单元格。
(比如使用 OleDb 连接和格式化连接)??


请分享您的知识

最佳答案

尝试使用 codeplex 中的 ExcelPlusPlus 库。它没有使用 OleDB

EPPlus link

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

关于c# - 有没有办法使用 C# 更改 Excel 单元格的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13467054/

相关文章:

c# - 使用 C# 访问特定的 VBA 代码模块

c# - 事件集锦

c# - SignalR "signalr/hubs"给出 404 错误

c# - iFrame 在 asp AjaxToolkit TabContainer 中加载两次

perl - 范围对象在 Excel 中的位置

excel - Axlsx,构建动态列

c# - 在 await 锁定期间 sleep 的正确方法

c# - 包中的 IntelliSense 和三重斜杠注释

c# - 无法转换类型为 'System.Collections.Generic.List` 1 的对象

c# - 将使用数据库部署在 Windows Azure 上的 ASP.NET 网站