title: Delphi - How to CANCEL Cut/Copy mode in Excel
body: <p>(Delphi XE6, Excel 2010/2013)</p>
  
  <p>While programming a plugin for Excel, I am having to copy data from one sheet and paste in another.  The copy and paste works fine...  However, at the end of the process, I am left with "Marching ants", i.e. the selection dotted lines, used for identifying what was copied.</p>
  
  <p>I have tried a couple of things....  In looking at various other articles, it says that I can make another selection, and that will take care of the issue. Assume I select/copy from sheet A, paste into Sheet B.  When I am done, I programmatically change back to Sheet A and then run the following code.</p>
  
  <pre><code> //StartingSheet.Cells(1, 1).Select;
     XLApp.Range['A1', 'A1'].Select;
  </code></pre>
  
  <p>My routine exist, gives control back to the user.  The ants are gone... HOWEVER, if I switch to sheet B, then back to sheet A, I can see cell A1 has a solid line around it, showing it has focus, and my last COPY selection will show the marching ants again.</p>
  
  <p>In looking at docs, there is a routine called cutcopymode.  It does NOT have a TRUE/FALSE value, ONLY xlCopy, or xlPaste.</p>
  
  <p>so...</p>
  
  <pre><code>XLApp.cutcopymode := false;
  </code></pre>
  
  <p>gives me an error.</p>
  
  <p>How do I truly get rid of the marching ants?</p>
  
  <p>Thanks</p>