Issue with excel ClearContents() API; MSDN

I copy a excel cell to multiple selected cells ( ctrl-C and ctrl-V manually ). I then try to run the above excel API to clear copied cells' contents. This was tried using C++ as well as using VBA, like:

C++
===
Range oRange; // create range object. Can't give details here.
oRange.ClearContents(); // hangs. never comes out.

VBA
===
ret = Worksheets("Name").Range(<select entire range>).ClearContents

It's a small range containing cells that were modified, say as less as 3 cells together.

The issue does not happen if I copy into each cell one by one ( say, ctrl-V 3 times to copy to 3 cells ). It also does not occur if I select and then copy to only 2 cells.

Basically, it occurs for copy to multiple cells ( more than 3 ) at once.

Strange enough ??
Last edited on
Topic archived. No new replies allowed.