Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I first time using Excel to reading data in c# with Selenium WebDriver, but when I build this code, it pops up an error:

"Missing compiler required member 'microsoft.csharp.runtimebinder.binder.convert'"

and the code for using excel is marked in red bellow:

 excel.Application x1Appl = new excel.Application();
 excel.Workbook x1WorkBook = x1Appl.Workbooks.Open(@"C:appoSearchBy.xlsx");

 excel._Worksheet x1WorkSheet = x1WorkBook.Sheets[1];

Please let me know what is missing? Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
511 views
Welcome To Ask or Share your Answers For Others

1 Answer

The reference assemblies for Office are exposed via the dynamic return type. To be able to compile you need to add a reference to Microsoft.CSharp.dll.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...