Hi,
Does anyone know how to cancel the selection of a block that has been copied
programmatically using C# and Excel Interop.
This is my current code:
rng=XLApp.get_Range("OrigRows",m); //selects the
row named OrigRows
XLApp.CutCopyMode = XlCutCopyMode.xlCopy;
rng.Select();
rng.Copy(m);
rng.Insert(XlInsertShiftDirection.xlShiftDown,m);
The above copies teh selected row in a sheet and then pastes it as a new
row.
Next I just want to cancel the selection, if I record the action of pressing
"Esc" in Excel it gives the code:
Application.CutCopyMode = False
When I try to do the same thing in C# I only get offered two options:
XlCutCopyMode.xlCopy
XlCutCopyMode.xlCut
How do I say:
XLApp.CutCopyMode=false;
As usual C# and VBA are highly incompatible (why???).
Siv
chanmm - 30 Oct 2006 09:48 GMT
rng is the Range object. You should be able to use the Range object in C#
as well.
chanmm
> Hi,
> Does anyone know how to cancel the selection of a block that has been
[quoted text clipped - 29 lines]
>
> Siv
Siv - 31 Oct 2006 16:54 GMT
I have looked at that and can't find anything that seems to cancel the
selection?
It's obviously obscure?
Cheers for responding.
Siv
> rng is the Range object. You should be able to use the Range object in C#
> as well.
[quoted text clipped - 34 lines]
>>
>> Siv
Mark Jerde - 31 Oct 2006 19:17 GMT
Just a thought -- can you move the cursor?
-- Mark
> I have looked at that and can't find anything that seems to cancel the
> selection?
[quoted text clipped - 41 lines]
>>>
>>> Siv