创建新的excel应用程序需要40秒

时间:2014-04-14 20:00:05

标签: c# .net excel

我的代码在这个语句上需要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
        }
    }
}

0 个答案:

没有答案