I am trying to merge cells using the Cells function. The code compiles,but the Excel spreadsheet that gets created doesn't have any merged cells. Assume ws is a _Worksheet. What am I doing wrong?
ws.Cells[1,1][2,2].Merge();
I thought this would merge the range "A1:B2," but it doesn't. Can you have two-dimensional Cells array? If so, what am I doing wrong? If not, why does the code compile?
Also, if instead of calling Merge I set the value of the two-dimensional array to "Hello world" then only cell B2 gets the hello world string. I expected the range A1:B2 to all get set to "Hello world." Why did this happen?
No comments:
Post a Comment