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










0















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.










share|improve this question
























  • 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
















0















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.










share|improve this question
























  • 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














0












0








0


1






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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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













2 Answers
2






active

oldest

votes


















0














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.






share|improve this answer






























    -1














    Use the following steps:-



    1. Go to your project and right click.

    2. Click on Add then click on Reference..

    3. Select Microsoft.CSharp and click on OK button then clean and
      rebuild your project.





    share|improve this answer










    New contributor




    Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.



















      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
      );



      );













      draft saved

      draft discarded


















      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









      0














      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.






      share|improve this answer



























        0














        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.






        share|improve this answer

























          0












          0








          0







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 23 '17 at 1:01









          Philip VenzPhilip Venz

          1




          1























              -1














              Use the following steps:-



              1. Go to your project and right click.

              2. Click on Add then click on Reference..

              3. Select Microsoft.CSharp and click on OK button then clean and
                rebuild your project.





              share|improve this answer










              New contributor




              Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.
























                -1














                Use the following steps:-



                1. Go to your project and right click.

                2. Click on Add then click on Reference..

                3. Select Microsoft.CSharp and click on OK button then clean and
                  rebuild your project.





                share|improve this answer










                New contributor




                Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






















                  -1












                  -1








                  -1







                  Use the following steps:-



                  1. Go to your project and right click.

                  2. Click on Add then click on Reference..

                  3. Select Microsoft.CSharp and click on OK button then clean and
                    rebuild your project.





                  share|improve this answer










                  New contributor




                  Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  Use the following steps:-



                  1. Go to your project and right click.

                  2. Click on Add then click on Reference..

                  3. Select Microsoft.CSharp and click on OK button then clean and
                    rebuild your project.






                  share|improve this answer










                  New contributor




                  Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer








                  edited yesterday









                  Hasta Tamang

                  8961815




                  8961815






                  New contributor




                  Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered yesterday









                  Ankur ChoudharyAnkur Choudhary

                  92




                  92




                  New contributor




                  Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Ankur Choudhary is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                      Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

                      How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page