View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Line breaks appear as squares in comments

Make sure Wrapped Cells are enabled.

from worksheet menu
format - Cells - Alignment - Wrap Text

Columns("A").WrapText = True



"Gustaf" wrote:

Using Excel 2007, and doing some work in VBA to add comments in certain cells. My problem is that at each line break, there is an outlined square. Have tried vbLf, vbCr, vbCrLf and vbNewLine and they all give the same result.

To be more specific, I use the XML DOM classes to create an XML document with line breaks in, but I don't think that should matter. A sample:

Set objElement = objDom.createElement("value")
objElement.Text = remoteCell.Value
objRoot.appendChild objDom.createTextNode(" ")
objRoot.appendChild objElement
objRoot.appendChild objDom.createTextNode(vbNewLine)

Gustaf