如何将数据保存到相同excel文件的3个excelsheets [英] how to save the data to 3 excelsheets of same excel file

查看:84
本文介绍了如何将数据保存到相同excel文件的3个excelsheets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在编写并使用以下代码将数据保存到excel文件中一个excel文件





Hi,

I am writing and saving the data to excel file in one excel sheet with the following code


if (File.Exists(path1))
   File.Delete(path1);
int i = 1;

foreach (DataRow row in ds1.Tables[0].Rows)
{
   xlWorkSheet.Cells[i, 1] = row[2];
   i++;
}

xlWorkBook.SaveAs(path1, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlShared, misValue, misValue, misValue, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);







如何将数据写入同一个excel文件的3个不同excel表中????



谢谢

John




How can write data to 3 different excel sheets of same excel file????

Thanks
John

推荐答案

您好b $ b

您可以按照链接进行操作,请创建单独的 xlWorkSheet ;-)



http://stackoverflow.com/questions/10100901/creating-simple-excel-sheet-in-c-sharp-with-strings-as -input [ ^ ]

[ ^ ]

http://www.c-sharpcorner.com/UploadFile/hrojasara/export-datagridview-to -excel-in-C-Sharp / [ ^ ]

使用C#创建Excel文档 [ ^ ]



最好的问候。
Hi
You can do it just follow of links please you should create separated xlWorkSheet ;-)

http://stackoverflow.com/questions/10100901/creating-simple-excel-sheet-in-c-sharp-with-strings-as-input[^]
[^]
http://www.c-sharpcorner.com/UploadFile/hrojasara/export-datagridview-to-excel-in-C-Sharp/[^]
Using C# to Create an Excel Document[^]

Best Regards.


阅读本文。它会对你有帮助。
Read this Article. It will help you.


这篇关于如何将数据保存到相同excel文件的3个excelsheets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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