Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Turning off Word-Wrap

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Turning off Word-Wrap

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning off Whole Word selection in Excel 2007 Neil in Bellevue[_2_] Excel Programming 0 April 14th 10 06:35 PM
Turning off whole word selection in Excel 2007 Neil in Bellevue Excel Programming 0 April 14th 10 06:11 PM
Copy from Word to Excel, and retain indent, plus word wrap Eric Excel Discussion (Misc queries) 1 March 9th 07 03:15 AM
In Excel 2003 Text Disappears After Turning On Word Wrap. [email protected] Excel Discussion (Misc queries) 1 March 6th 07 01:59 AM
Turning Excel Worksheet Linked to Word Document into Report Templa Jordan Rose Excel Programming 0 September 19th 05 06:19 PM


All times are GMT +1. The time now is 05:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"