开发者

Excel with C# connection

开发者 https://www.devze.com 2023-02-07 01:51 出处:网络
I have this code exapplication = new Excel.A开发者_开发技巧pplication(); Excel.Workbook WB = exapplication.ThisWorkbook;

I have this code

exapplication = new Excel.A开发者_开发技巧pplication();
Excel.Workbook WB = exapplication.ThisWorkbook;
WB.Connections.AddFromFile("C:\test.odc");

and when I trying to compile it, it gives me the following exception:

Exception from HRESULT: 0x800A03EC


You should replace

WB.Connections.AddFromFile("C:\test.odc");

by

WB.Connections.AddFromFile(@"C:\test.odc");

although I don't really think that exception is because of this.

0

精彩评论

暂无评论...
验证码 换一张
取 消