合并的Excel文件合并成一个 [英] Merge Excel Files Into One

查看:206
本文介绍了合并的Excel文件合并成一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几百个Excel文件,每个文件的第一页上的一些数据。我被要求写在C#控制台应用程序,合并所有的Excel文件整合到一个单一的文件,同时保留格式。

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.

合并文件是含有片为每个文件一个工作簿合并到文档中。遗憾的是,Excel文件是二进制,而不是XML格式,所以无法进行XSL转换。

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.

是否有免费的图书馆或样品code这表明如何从多个Excel文档的表合并成一个单一的文件?

推荐答案

您将需要使用的Microsoft Excel互操作库。 http://msdn.microsoft.com/en-us /library/microsoft.office.interop.excel.aspx

You'll need to use the Microsoft Excel Interop library. http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.aspx

您应该能够添加一个引用,在COM选项卡中,到Microsoft Excel 11对象库。

You should be able to add a reference, in the com tab, to Microsoft Excel 11 Object Library.

http://msdn.microsoft.com/ EN-US /库/ ms173186(VS.80)的.aspx

这篇关于合并的Excel文件合并成一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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