Reading data from excel in selenium C#2019 Community Moderator ElectionHow do I calculate someone's age in C#?What is the difference between String and string in C#?Hidden Features of C#?Cast int to enum in C#How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?What are the correct version numbers for C#?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Get int value from enum in C#An exception in reading data from excel using C# selenium web driverHow to get datagridview1 to split as two or three in current excel sheet
Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?
Learning to quickly identify valid fingering for piano?
Practical reasons to have both a large police force and bounty hunting network?
Why do phishing e-mails use faked e-mail addresses instead of the real one?
“I had a flat in the centre of town, but I didn’t like living there, so …”
What is the meaning of option 'by' in TikZ Intersections
Why doesn't "adolescent" take any articles in "listen to adolescent agonising"?
New invention compresses matter to produce energy? or other items? (Short Story)
Convert an array of objects to array of the objects' values
If nine coins are tossed, what is the probability that the number of heads is even?
What does "rhumatis" mean?
Problems with rounding giving too many digits
Can a space-faring robot still function over a billion years?
The need of reserving one's ability in job interviews
Do natural melee weapons (from racial traits) trigger Improved Divine Smite?
Does the in-code argument passing conventions used on PDP-11's have a name?
Is divide-by-zero a security vulnerability?
Why is there an extra space when I type "ls" on the Desktop?
Was it really inappropriate to write a pull request for the company I interviewed with?
PTiJ: How should animals pray?
Why would the IRS ask for birth certificates or even audit a small tax return?
I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?
Naming Characters after Friends/Family
Computing the volume of a simplex-like object with constraints
Reading data from excel in selenium C#
2019 Community Moderator ElectionHow do I calculate someone's age in C#?What is the difference between String and string in C#?Hidden Features of C#?Cast int to enum in C#How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?What are the correct version numbers for C#?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Get int value from enum in C#An exception in reading data from excel using C# selenium web driverHow to get datagridview1 to split as two or three in current excel sheet
I'm trying to read username and password from excel sheet while using Selenium in C# .NET. Below is the code:
using excel = Microsoft.Office.Interop.Excel;
public void TestMethod1()
excel.Application xlApp = new excel.Application();
excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:TestTestData.xlsx");
excel._Worksheet xlWorksheet = **xlWorkbook.Sheets[1];**
excel.Range xlRange = xlWorksheet.UsedRange;
I'm getting the following error at the text that is marked in bold in above code:
Error CS0656 Missing compiler required member
'Microsoft.CSharp.RuntimeBinder.Binder.Convert' Read Data From
Excel_Office c:userstabish.khandocumentsvisual studio
2015ProjectsRead Data From Excel_OfficeRead Data From
Excel_OfficeOfficeReadExcel.cs 18 Active
Please help me resolve this issue.
c# .net selenium automation
add a comment |
I'm trying to read username and password from excel sheet while using Selenium in C# .NET. Below is the code:
using excel = Microsoft.Office.Interop.Excel;
public void TestMethod1()
excel.Application xlApp = new excel.Application();
excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:TestTestData.xlsx");
excel._Worksheet xlWorksheet = **xlWorkbook.Sheets[1];**
excel.Range xlRange = xlWorksheet.UsedRange;
I'm getting the following error at the text that is marked in bold in above code:
Error CS0656 Missing compiler required member
'Microsoft.CSharp.RuntimeBinder.Binder.Convert' Read Data From
Excel_Office c:userstabish.khandocumentsvisual studio
2015ProjectsRead Data From Excel_OfficeRead Data From
Excel_OfficeOfficeReadExcel.cs 18 Active
Please help me resolve this issue.
c# .net selenium automation
Did you google the error message? What did you find? What did you try to fix it?
– JeffC
Mar 20 '17 at 16:24
@Mark, yes I tried googling the error. None of the solutions worked. One of the solutions asked me to add the Microsoft.CSharp.dll file. This too didn't work.
– Tabish Khan
Mar 20 '17 at 16:32
add a comment |
I'm trying to read username and password from excel sheet while using Selenium in C# .NET. Below is the code:
using excel = Microsoft.Office.Interop.Excel;
public void TestMethod1()
excel.Application xlApp = new excel.Application();
excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:TestTestData.xlsx");
excel._Worksheet xlWorksheet = **xlWorkbook.Sheets[1];**
excel.Range xlRange = xlWorksheet.UsedRange;
I'm getting the following error at the text that is marked in bold in above code:
Error CS0656 Missing compiler required member
'Microsoft.CSharp.RuntimeBinder.Binder.Convert' Read Data From
Excel_Office c:userstabish.khandocumentsvisual studio
2015ProjectsRead Data From Excel_OfficeRead Data From
Excel_OfficeOfficeReadExcel.cs 18 Active
Please help me resolve this issue.
c# .net selenium automation
I'm trying to read username and password from excel sheet while using Selenium in C# .NET. Below is the code:
using excel = Microsoft.Office.Interop.Excel;
public void TestMethod1()
excel.Application xlApp = new excel.Application();
excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:TestTestData.xlsx");
excel._Worksheet xlWorksheet = **xlWorkbook.Sheets[1];**
excel.Range xlRange = xlWorksheet.UsedRange;
I'm getting the following error at the text that is marked in bold in above code:
Error CS0656 Missing compiler required member
'Microsoft.CSharp.RuntimeBinder.Binder.Convert' Read Data From
Excel_Office c:userstabish.khandocumentsvisual studio
2015ProjectsRead Data From Excel_OfficeRead Data From
Excel_OfficeOfficeReadExcel.cs 18 Active
Please help me resolve this issue.
c# .net selenium automation
c# .net selenium automation
edited Mar 20 '17 at 11:27
Mark Fitzgerald
2,71231829
2,71231829
asked Mar 20 '17 at 11:00
Tabish KhanTabish Khan
386
386
Did you google the error message? What did you find? What did you try to fix it?
– JeffC
Mar 20 '17 at 16:24
@Mark, yes I tried googling the error. None of the solutions worked. One of the solutions asked me to add the Microsoft.CSharp.dll file. This too didn't work.
– Tabish Khan
Mar 20 '17 at 16:32
add a comment |
Did you google the error message? What did you find? What did you try to fix it?
– JeffC
Mar 20 '17 at 16:24
@Mark, yes I tried googling the error. None of the solutions worked. One of the solutions asked me to add the Microsoft.CSharp.dll file. This too didn't work.
– Tabish Khan
Mar 20 '17 at 16:32
Did you google the error message? What did you find? What did you try to fix it?
– JeffC
Mar 20 '17 at 16:24
Did you google the error message? What did you find? What did you try to fix it?
– JeffC
Mar 20 '17 at 16:24
@Mark, yes I tried googling the error. None of the solutions worked. One of the solutions asked me to add the Microsoft.CSharp.dll file. This too didn't work.
– Tabish Khan
Mar 20 '17 at 16:32
@Mark, yes I tried googling the error. None of the solutions worked. One of the solutions asked me to add the Microsoft.CSharp.dll file. This too didn't work.
– Tabish Khan
Mar 20 '17 at 16:32
add a comment |
2 Answers
2
active
oldest
votes
I have the same error with my C# Class Library project. I'm using .NET Framework 4.6 and I used NuGet to install the Microsoft.Office.Interop.Excel assembly:
PM> Install-Package Microsoft.Office.Interop.Excel
Here is a simplified version of the code which causes this error:
using MSExcel = Microsoft.Office.Interop.Excel;
namespace ProjectReader
public class ExcelExport
public ExcelExport()
xlApp = new MSExcel.Application();
xlWorkBook = xlApp.Workbooks.Add(System.Reflection.Missing.Value);
public void CreateFile()
object missingValue = System.Reflection.Missing.Value;
foreach (MSExcel.Worksheet sht in xlWorkBook.Sheets)
if (xlWorkBook.Worksheets.Count > 1)
sht.Delete();
**xlWorkSheet = (MSExcel.Worksheet)xlWorkBook.Sheets[1];**
private MSExcel.Application xlApp;
private MSExcel.Workbook xlWorkBook;
private MSExcel.Worksheet xlWorkSheet;
Interestingly, I have no issues referencing the worksheets in the foreach loop just above the offending line.
add a comment |
Use the following steps:-
- Go to your project and right click.
- Click on Add then click on Reference..
- Select
Microsoft.CSharp
and click on OK button then clean and
rebuild your project.
New contributor
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42901883%2freading-data-from-excel-in-selenium-c-sharp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have the same error with my C# Class Library project. I'm using .NET Framework 4.6 and I used NuGet to install the Microsoft.Office.Interop.Excel assembly:
PM> Install-Package Microsoft.Office.Interop.Excel
Here is a simplified version of the code which causes this error:
using MSExcel = Microsoft.Office.Interop.Excel;
namespace ProjectReader
public class ExcelExport
public ExcelExport()
xlApp = new MSExcel.Application();
xlWorkBook = xlApp.Workbooks.Add(System.Reflection.Missing.Value);
public void CreateFile()
object missingValue = System.Reflection.Missing.Value;
foreach (MSExcel.Worksheet sht in xlWorkBook.Sheets)
if (xlWorkBook.Worksheets.Count > 1)
sht.Delete();
**xlWorkSheet = (MSExcel.Worksheet)xlWorkBook.Sheets[1];**
private MSExcel.Application xlApp;
private MSExcel.Workbook xlWorkBook;
private MSExcel.Worksheet xlWorkSheet;
Interestingly, I have no issues referencing the worksheets in the foreach loop just above the offending line.
add a comment |
I have the same error with my C# Class Library project. I'm using .NET Framework 4.6 and I used NuGet to install the Microsoft.Office.Interop.Excel assembly:
PM> Install-Package Microsoft.Office.Interop.Excel
Here is a simplified version of the code which causes this error:
using MSExcel = Microsoft.Office.Interop.Excel;
namespace ProjectReader
public class ExcelExport
public ExcelExport()
xlApp = new MSExcel.Application();
xlWorkBook = xlApp.Workbooks.Add(System.Reflection.Missing.Value);
public void CreateFile()
object missingValue = System.Reflection.Missing.Value;
foreach (MSExcel.Worksheet sht in xlWorkBook.Sheets)
if (xlWorkBook.Worksheets.Count > 1)
sht.Delete();
**xlWorkSheet = (MSExcel.Worksheet)xlWorkBook.Sheets[1];**
private MSExcel.Application xlApp;
private MSExcel.Workbook xlWorkBook;
private MSExcel.Worksheet xlWorkSheet;
Interestingly, I have no issues referencing the worksheets in the foreach loop just above the offending line.
add a comment |
I have the same error with my C# Class Library project. I'm using .NET Framework 4.6 and I used NuGet to install the Microsoft.Office.Interop.Excel assembly:
PM> Install-Package Microsoft.Office.Interop.Excel
Here is a simplified version of the code which causes this error:
using MSExcel = Microsoft.Office.Interop.Excel;
namespace ProjectReader
public class ExcelExport
public ExcelExport()
xlApp = new MSExcel.Application();
xlWorkBook = xlApp.Workbooks.Add(System.Reflection.Missing.Value);
public void CreateFile()
object missingValue = System.Reflection.Missing.Value;
foreach (MSExcel.Worksheet sht in xlWorkBook.Sheets)
if (xlWorkBook.Worksheets.Count > 1)
sht.Delete();
**xlWorkSheet = (MSExcel.Worksheet)xlWorkBook.Sheets[1];**
private MSExcel.Application xlApp;
private MSExcel.Workbook xlWorkBook;
private MSExcel.Worksheet xlWorkSheet;
Interestingly, I have no issues referencing the worksheets in the foreach loop just above the offending line.
I have the same error with my C# Class Library project. I'm using .NET Framework 4.6 and I used NuGet to install the Microsoft.Office.Interop.Excel assembly:
PM> Install-Package Microsoft.Office.Interop.Excel
Here is a simplified version of the code which causes this error:
using MSExcel = Microsoft.Office.Interop.Excel;
namespace ProjectReader
public class ExcelExport
public ExcelExport()
xlApp = new MSExcel.Application();
xlWorkBook = xlApp.Workbooks.Add(System.Reflection.Missing.Value);
public void CreateFile()
object missingValue = System.Reflection.Missing.Value;
foreach (MSExcel.Worksheet sht in xlWorkBook.Sheets)
if (xlWorkBook.Worksheets.Count > 1)
sht.Delete();
**xlWorkSheet = (MSExcel.Worksheet)xlWorkBook.Sheets[1];**
private MSExcel.Application xlApp;
private MSExcel.Workbook xlWorkBook;
private MSExcel.Worksheet xlWorkSheet;
Interestingly, I have no issues referencing the worksheets in the foreach loop just above the offending line.
answered Mar 23 '17 at 1:01
Philip VenzPhilip Venz
1
1
add a comment |
add a comment |
Use the following steps:-
- Go to your project and right click.
- Click on Add then click on Reference..
- Select
Microsoft.CSharp
and click on OK button then clean and
rebuild your project.
New contributor
add a comment |
Use the following steps:-
- Go to your project and right click.
- Click on Add then click on Reference..
- Select
Microsoft.CSharp
and click on OK button then clean and
rebuild your project.
New contributor
add a comment |
Use the following steps:-
- Go to your project and right click.
- Click on Add then click on Reference..
- Select
Microsoft.CSharp
and click on OK button then clean and
rebuild your project.
New contributor
Use the following steps:-
- Go to your project and right click.
- Click on Add then click on Reference..
- Select
Microsoft.CSharp
and click on OK button then clean and
rebuild your project.
New contributor
edited yesterday
Hasta Tamang
8961815
8961815
New contributor
answered yesterday
Ankur ChoudharyAnkur Choudhary
92
92
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42901883%2freading-data-from-excel-in-selenium-c-sharp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you google the error message? What did you find? What did you try to fix it?
– JeffC
Mar 20 '17 at 16:24
@Mark, yes I tried googling the error. None of the solutions worked. One of the solutions asked me to add the Microsoft.CSharp.dll file. This too didn't work.
– Tabish Khan
Mar 20 '17 at 16:32