Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel Interop - Cancel selection

I'm copying and inserting rows in an Excel sheet, like so:

   while (rowsToAdd > 0)
   {
      // copy the existing row
      insertionCell.EntireRow.Copy(Type.Missing);

      // location of the new row
      Range newRow = insertionCell.EntireRow.get_Offset(1, 0).EntireRow;

      // insert the new row
      newRow.Insert(XlInsertShiftDirection.xlShiftDown, Type.Missing);

      rowsToAdd--;
   }

The problem I have is that sometimes, I'm left with a selection marquee around the row I originally copied.

Is there a way I can cancel the selection marquee (the way you'd normally do it with the Escape key?)

like image 947
Charlie Salts Avatar asked Oct 17 '25 07:10

Charlie Salts


1 Answers

In VBA it's Application.CutCopyMode = False

like image 183
Doug Glancy Avatar answered Oct 18 '25 20:10

Doug Glancy