修改Excel的小号preadsheet与.NET小号、Excel、NET、preadsheet

2023-09-03 03:08:54 作者:装逼做作死的快

下面的问题:

我在使用.NET修改现有的Excel US preadsheet。在S preadsheet是非常复杂的,我只需要在某些predefined区域添加数据。

I have to modify an existing Excel spreadsheet using .NET. The spreadsheet is hugely complex, and I just have to add data in some predefined areas.

我调查我的选择,和Excel自动化/互操作是不可能的,因为我实现一个ASP.NET网站,和Excel可能不是安装在服务器上。从我在网上找的,互操作也是非常昂贵的performancewise解决方案。

I'm investigating my options, and Excel Automation/InterOp is out of the question, as I'm implementing an ASP.NET website, and Excel probably isn't installed on the server. From what I find online, InterOp is also a very expensive solution performancewise.

创建一个CSV文件也被排除,因为对原来的S preadsheet的复杂性了。

Creating a CSV file is also ruled out because of the complex nature of the original spreadsheet.

目前我倾向于一个ADO.NET OleDb的解决方案,但我发现,提到很少(谷歌和Stackoverflow.com),所以我有点担心:什么是与OLDDB Excel的收获? 唯一的缺点,我可以在MSDN上找到这么远,是我不能创建细胞的公式,但是这真的不是在我的情况的问题。

Currently I'm leaning towards an ADO.NET OleDb solution, but I find that mentioned very rarely (Google and Stackoverflow.com) so I'm kinda worried: What's the catch with OldDb for Excel? The only drawback I can find on MSDN so far, is that I can't create cells with formulas, but that's really not an issue in my case.

我也考虑SSIS,但是这只是基于我的假设,当你产生US preadsheets,您可以使用现有的Excel文件。我不知道这是否可以或不可以

I've also considered SSIS, but that's only based on my assumption that you can use existing Excel files when you generate spreadsheets. I don't know if that possible or not.

再有就是OPENXML。这似乎过于复杂相比OLDDB,再加上它仍然未确定这些旧的Excel版本的我都支持。

Then there's OpenXml. It seems overly complicated compared to OldDb, plus it's still undetermined which of the older Excel versions I have to support.

我缺少的东西?是否有更多的选择?

Am I missing something? Are there more alternatives?

推荐答案

在这种情况下,我通常会赞成不搞乱复杂的小号preadsheet,而是建立一个单独的数据文件,而我将连接数据单元在复杂小号preadsheet。这比从外部不断变化的复杂的小号preadsheet更清洁,更安全。

In that situation, I would normally favour not messing with the complex spreadsheet, but setting up a separate data file, to which I would link the data cells in the complex spreadsheet. This is much cleaner and safer than changing a complex spreadsheet from outside.

如果这不是比你目前所面临的替代品更容易,这让我感到吃惊。但是,我还没有看到您的S preadsheet。

If this is not easier than the alternatives you are currently facing,it would surprise me. But then I haven't seen your spreadsheet.