Ahmadhejazi
Ahmadhejazi

Reputation: 1

Excel with C# connection

I have this code

exapplication = new Excel.Application();
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

Upvotes: 0

Views: 397

Answers (1)

Oscar Mederos
Oscar Mederos

Reputation: 29823

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.

Upvotes: 1

Related Questions