110,502
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Excel = Microsoft.Office.Interop.Excel;
namespace ConsoleApplication1
{
public class Test
{
static void Main()
{
string fileTest = "E:\\test.xlsx";
Excel.Application oApp = new Excel.Application();
Excel.Workbook oBook = oApp.Workbooks.Add();
Excel.Worksheet oSheet = (Excel.Worksheet)oBook.Worksheets.get_Item(1);
oSheet.Cells[1, 1] = "some value";
oBook.SaveAs(fileTest);
oBook.Close();
oApp.Quit();
}
}
}