合并Excel文件 [英] Merge Excel Files Into One
问题描述
合并文件是一个工作簿包含合并到文档中的每个文件的工作表。不幸的是,Excel文件是二进制而不是XML格式,所以我无法执行XSL转换。
是否有免费的库或示例代码演示了如何将多个Excel文档的表格组合成单个文件?
您需要使用Microsoft Excel Interop库。 http://msdn.microsoft.com/en- us / library / microsoft.office.interop.excel.aspx
您应该可以在com选项卡中添加引用到Microsoft Excel 11对象库。
http://msdn.microsoft.com/en-us/library/ms173186(VS.80).aspx
I have a few hundred Excel files, where each file has some data on the first sheet. I've been asked to write a console application in C# which merges all of the Excel files together into a single document while retaining the formatting.
The consolidated file is a single workbook containing a sheet for each file merged into the document. Unfortunately, the Excel files are in binary rather than XML format, so I can't perform an XSL transformation.
Is there are free library or sample code which demonstrates how to combine a sheets from multiple Excel documents into a single file?
You'll need to use the Microsoft Excel Interop library. http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.aspx
You should be able to add a reference, in the com tab, to Microsoft Excel 11 Object Library.
http://msdn.microsoft.com/en-us/library/ms173186(VS.80).aspx
这篇关于合并Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!