最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用C#生成Excel文件的方法和Excel.dll组件生成的方法
时间:2022-07-02 11:08:59 编辑:袖梨 来源:一聚教程网
一个示例:
class AppTest
{
private .ApplicationClass _x;
public static void Main0()
{
AppTest a = new AppTest();
a._x = new Excel.ApplicationClass();
a._x.UserControl = false;
for (int i = 0 ;i {
a.SaveToXls("D:test" + i + ".xls"); // 本例是在D盘下建立的test文件夹
}
a._x.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject((object) a._x);
System.GC.Collect();
}
private void SaveToXls(string filename)
{
Excel.WorkbookClass wb = (Excel.WorkbookClass) this._x.Workbooks.Add(System.Reflection.Missing.Value);
for(int i = 1;i {
this._x.Cells[i,1]=i.ToString();
this._x.Cells[i,2]="bbb2";
相关文章
- 腾讯视频网页版入口在哪-腾讯视频网页版入口链接 02-10
- 歪歪漫画最新入口地址:2026年热门韩漫同步连载中 02-10
- 蛙漫2台版入口网页最新版-蛙漫2台版入口网页最新访问链接 02-10
- 创游世界网页版入口-创游世界网页版直达链接 02-10
- 12360火车票余票查询-如何在线查询火车票余票 02-10
- 抖音官网网页版入口-抖音网页版在线观看链接 02-10