W
WillisCat
If I write
Cells(3, 5).Value2 = :"a very long string of characters"
in Excel VBA, the result is that string of characters stored in cell
E3. Because the string is longer than the width of the cell, it
extends out of the cell into the cells to the right, if those cells
have no values. If I subsequently format the cell to be right-aligned,
the text begins in a cell to the left of E3. Just what I would expect.
However, if I do the same thing with a C++ program using OLE
automation, the long string is word-wrapped in cell E3 and the height
of row 3 is increased to contain the word-wrapped text.
Any idea why I get different results when the automation is controlled
by a C++ program rather than VBA? And more importantly, how can I
prevent this from happening?
I've tried using Value as well as Value2 and I've tried setting the
WordWrap property to False. No successes yet.
Willis
Cells(3, 5).Value2 = :"a very long string of characters"
in Excel VBA, the result is that string of characters stored in cell
E3. Because the string is longer than the width of the cell, it
extends out of the cell into the cells to the right, if those cells
have no values. If I subsequently format the cell to be right-aligned,
the text begins in a cell to the left of E3. Just what I would expect.
However, if I do the same thing with a C++ program using OLE
automation, the long string is word-wrapped in cell E3 and the height
of row 3 is increased to contain the word-wrapped text.
Any idea why I get different results when the automation is controlled
by a C++ program rather than VBA? And more importantly, how can I
prevent this from happening?
I've tried using Value as well as Value2 and I've tried setting the
WordWrap property to False. No successes yet.
Willis