简体   繁体   English

OpenXML SDK-合并多个Excel文件

[英]OpenXML SDK - Combine multiple Excel Files

I have 2 files. 我有2个档案。 I have Test1.xlsx and Test2.xlsx that I need to combine it problematically. 我有Test1.xlsx和Test2.xlsx,需要将其组合成问题。 What is the best way to do this? 做这个的最好方式是什么? I am using C#, MVC 3. 我正在使用C#,MVC 3。

I have seen mention of AltChunk but have seen it used with Documents and SpreadSheets. 我看到过提到AltChunk,但看到它与Documents和SpreadSheets一起使用。

We need more information to answer this questions. 我们需要更多信息来回答这个问题。

Do you want to write VBA code to combine them? 您是否要编写VBA代码以将它们组合在一起? Do you want to just copy a tab from one of them and move it to the other? 您是否只想复制其中一个标签并将其移至另一个标签? Do they have similar column headers and would it make sense to use access to append them together? 它们是否具有相似的列标题,并且使用访问权限将它们附加在一起是否有意义? It all depends on what you are trying to do. 这完全取决于您要执行的操作。

If you just want to copy a tab from test1.xlsx to test2.xlsx then go to the correct tab in test1 and right click on the tab. 如果您只想将一个选项卡从test1.xlsx复制到test2.xlsx,请转到test1中的正确选项卡,然后右键单击该选项卡。 then click move or copy. 然后单击移动或复制。 In the "to book" field select test2 (test2 will need to be open at the same time), and then select the create a copy box and click ok. 在“预订”字段中,选择test2(需要同时打开test2),然后选择“创建副本”框并单击“确定”。

If you want to automate something that combines excel files together you could do it using VBA which is also another option. 如果要自动化将excel文件组合在一起的操作,则可以使用VBA来完成,这也是另一种选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM