,新建C#控制台应用程序(Excel创建图表) using System; using System.Collections.Generic; using System.Linq; using System.Text; //解决方案中 添加引用 Execl(COM组件) using MSExcel = Microsoft.Office.Interop.Excel; using System.IO; using System.Reflection; namespace ExeclCharts {
1.引用Microsoft.Office.Interop.Excel.dll 2.引用命名空间.使用别名 using System.Reflection; using Excel = Microsoft.Office.Interop.Excel; 3.写入excel 写入函数 public void ToExcel(string strTitle) { int nMax = 9; int nMin = 4; int rowCount = nMax - nMin + 1;//总行数 const i
public void SearchLoactions(string filepath, int start, int end ,string expectvalue) { if (end >= start) { Application xlApp = new Application(); try { if (!File.Exists(filepath)) throw new FileNotFoundException("Can not find the file, please chec