Hi,
I need assistance in writing data to excel 2007 using c#.net. Previously in vsts 2010 beta 1 release, i wrote code for the same which is not working in beta 2. I am not able to add reference to microsoft.excel.library 12.0
please help
Microsoft.Office.Interop.Excel.Application objApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook objBook = objApp.Workbooks.Open("C:\\Result1.xls",0,false,5,"","",true,"","\t",false,false,0,1,true,1);
Microsoft.Office.Interop.Excel.Sheets objSheets = objBook.Worksheets;
Microsoft.Office.Interop.Excel.Worksheet objSheet = (Microsoft.Office.Interop.Excel.Worksheet)objSheets.get_Item(1);
//objSheet.Cells[2, 2] = "PASS";
//objSheet.get_Range("B2").Interior.Color = System.Drawing.Color.Green;
//objSheet.get_Range("B2").Font.Color = System.Drawing.Color.White;
//objSheet.get_Range("B2").Font.Bold = true;
This code is not working . it reports error as
Error 1 Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported TestProject5
Error 2 One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll? C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Projects\TestProject5\CodedUITest1.cs 36 65 TestProject5