这里的错误是“范围是一个变量,但用作一种方法”
我添加了“Microsoft.Office.Interop.Excel”并将其当前用作
Microsoft.Office.Interop.Excel.Workbook SelWorkBook = excelappln1.Workbooks.Open(curfile, 0, false, 5, "", "", false,
Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true,
false, 0, false, false, false);
Microsoft.Office.Interop.Excel.Sheets excelSheets = SelWorkBook.Worksheets;
Microsoft.Office.Interop.Excel.Worksheet excelworksheet = (Microsoft.Office.Interop.Excel.Worksheet)excelSheets.get_Item(CurSheetName);
Microsoft.Office.Interop.Excel.Range excelRange = excelworksheet.UsedRange;
object[,] value;
excelRange = excelworksheet.get_Range(CurTaskNode.DATA_MIN_ROW, CurTaskNode.DATA_MIN_COL);
value = (object[,])excelRange.Cells.Value2;
and using the Value to check the cell is locked or not....
if (!value (excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol]).Locked)
{
// Assigning the Value from reader to the particular cell in excel sheet
excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol] = values[iValueIndex];
iValueIndex++;
}
它显示了错误 - 值是一个变量,但用作方法..
请帮我
谢谢
拉姆