Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I really have no experience, but I'd start looking at the cell formatting
properties in the two environments - Cell.WrapText is a boolean "WillisCat" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Turning off Whole Word selection in Excel 2007 | Excel Programming | |||
Turning off whole word selection in Excel 2007 | Excel Programming | |||
Copy from Word to Excel, and retain indent, plus word wrap | Excel Discussion (Misc queries) | |||
In Excel 2003 Text Disappears After Turning On Word Wrap. | Excel Discussion (Misc queries) | |||
Turning Excel Worksheet Linked to Word Document into Report Templa | Excel Programming |