Cannot open Excel file in C#

后端 未结 4 1762
天涯浪人
天涯浪人 2021-02-19 21:51

I have the following C# function in my project, which is supposed to open and return an existing Excel workbook object:

Application _excelApp;

// ...

private W         


        
4条回答
  •  生来不讨喜
    2021-02-19 22:01

    Run the program as admin, the C:/ cannot be accessed by a program unless the user is running as admin. You can make your program prompt the user it must be run as admin by altering the ApplicationManifest: How do I force my .NET application to run as administrator?

提交回复
热议问题