如何在导出Excel时将工作表添加为Excel工作表中的第一个工作表。 [英] How to add a sheet as a first sheet in a excel sheet while exporting excel .
问题描述
如何在导出Excel时在Excel工作表中添加工作表作为第一张工作表。
。已存在2张工作表。现在我想在导出Excel时在该Excel中添加新工作表使用openxml。
我尝试过:
https:/ /msdn.microsoft.com/en-us/library/office/cc881781.aspx
此链接添加表单的解决方案。但不首先它在excel中添加最后一页
How to add a sheet as a first sheet in a excel sheet while exporting excel .
.Existing sheet having 2 sheets already.Now i wants to add a new sheet in that excel while exporting excel using openxml.
What I have tried:
https://msdn.microsoft.com/en-us/library/office/cc881781.aspx
solution in this link adding a sheet . but not first it adding as a last sheet in excel
推荐答案
没有尝试过这样做,但是看一下在网上找到的一些建议,你可以尝试一下喜欢 -
Haven't tried to do this, but looking at few suggestions found on the web, you can try something like-
workbook.Sheets.Add(Before: workbook.Sheets[0]);
查看以下链接以获取更多信息 -
c# - Excel Interop - 在所有其他工作表之后添加一个新的工作表 - Stack Overflow [ ^ ]
工作表。移动方法(Microsoft.Office.Tools.Excel) [ ^ ]
希望,它帮助:)
Check following links for further information-
c# - Excel Interop - Add a new worksheet after all of the others - Stack Overflow[^]
Worksheet.Move Method (Microsoft.Office.Tools.Excel)[^]
Hope, it helps :)
这篇关于如何在导出Excel时将工作表添加为Excel工作表中的第一个工作表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!