richard smith

richard smith

  • 1.5k
  • 285
  • 160.3k

Check if Cells A2 and A3 are blank in Excel

Mar 29 2013 11:16 PM
I tried this code:

public static void CellsBlank()
{
Worksheet worksheet;
Workbook wb = Global.Variables.GlobalVariables.oXL.ActiveWorkbook;
Excel.Range cell1 = (Excel.Range)worksheet.get_Range("A2", "A2");
Excel.Range cell2 = (Excel.Range)worksheet.get_Range("A3", "A3");
}

But that throws a debug error when it hits my Excel.Range cell1 line!  How should I re-write this?

Answers (3)