我的代码在这个语句上需要40秒:Application xlsApp = new Application(); 知道为什么会这样吗?我在本地运行。
using System;
using System.Linq;
using Microsoft.Office.Interop.Excel;
namespace Mynamespace.Controllers
{
public class ExcelParser
{
public static string[] ReadIdColumn(string filename)
{
Application xlsApp = new Application();// have breakpoint here and takes 40 seconds from this line to the next.
Workbook wb = xlsApp.Workbooks.Open(filename,
0, true, 5, "", "", true, XlPlatform.xlWindows, "\t", false, false, 0, true);
//parsing and other logic here
}
}
}