附加* .xls表,但保留当前样式 [英] Appending *.xls sheet but keep the current style

查看:83
本文介绍了附加* .xls表,但保留当前样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在处理Excel工作表的C#项目中.我想在工作表的末尾追加内容,并且不更改当前工作表的样式.
我可以使用Microsoft.Interop.Excel做到这一点,但是当用户不使用MS Excel软件时,这似乎很困难.
我尝试 ExcelLibrary NPOI ,但是他们制作了表格失去了风格.
互联网上有任何有用的图书馆吗?请帮帮我.
谢谢,

Hi there,
I''m working in a C# project that processing the Excel sheet. I want to append at the end of sheet and make no changes to the current style of sheet.
I can do it with Microsoft.Interop.Excel but it seems to be difficult when a user don''t use MS Excel software.
I try ExcelLibrary and NPOI but they make the sheet lost its style.
Is there any helpful library on the Internet? Please help me.
Thanks,

推荐答案

尝试OleDbConnection.

样本:
var excelConnection = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0; Data Source =" + location +; Mode = ReadWrite; Extended Properties = Excel 8.0;");
excelConnection.Open();

否则LinqToExcel

问候
Piet
Try OleDbConnection.

Sample :
var excelConnection = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + location + ";Mode=ReadWrite;Extended Properties=Excel 8.0;");
excelConnection.Open();

Or else LinqToExcel

Regards
Piet


这篇关于附加* .xls表,但保留当前样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆