创建对象:
CBExcel exUtil = new CBExcel();
函数调用:
if (!File.Exists(PublicValue.ExcelPath))
{
exUtil.Create(PublicValue.ExcelPath, "list", "backup", "other");
exUtil.Open(PublicValue.ExcelPath, "list");
exUtil.SetValue(1, 1, PublicValue.StockReservd);
exUtil.CloseAndSave();}
}
程序模板:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Excel;
using Excel = Microsoft.Office.Interop.Excel;
using System.Reflection;
using System.IO;
namespace MouseAction
{
public class CBExcel
{
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;