使用C#访问Excel工作表中的单元格

时间:2013-11-12 11:43:33

标签: c# excel

我需要使用C#访问Excel工作表中的单元格。我尝试使用以下代码:

if (xlWorksheet.Cells[k + 5, 0] == Convert.ToString(ent.Cells[i, 3].Value))
{ 
     p = k;
}

Visual Studio中出现以下消息:

Error 1 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?

1 个答案:

答案 0 :(得分:1)

 if (xlWorksheet.Cells[k + 5, 0].Text == Convert.ToString(ent.Cells[i, 3].Value   ))
   { 
     p = k;
   }
相关问题