Excel: can only open file if using absolute path, why?

后端 未结 4 2042
感情败类
感情败类 2021-01-12 05:11

I have some trouble to understande why I´m getting an exception. I have something like this:

string path = \"file.xls\";
if (File.Exists(path))
{
  Excel.App         


        
4条回答
  •  春和景丽
    2021-01-12 05:22

    i think it is because xlApp.Workbooks.Open function only knows the absolute path,not likes File.Exists function

提交回复
热议问题