Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 certain cell 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 ??
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900