Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage return creates open box character in spreadsheet generation

Status
Not open for further replies.

ktri

Programmer
Feb 6, 2006
1
US
I am generating an XML spreadsheet thru ASP using the FSO. The spreadsheet will be opened via Excel. In one cell I need to show several pieces of data on their own line inside the cell.

I am pulling info from an Oracle database and no matter what character I use for a carriage return (have tried chr(13), vbNewLine, vbcrlf, chr(10) and chr(10)&chr(13)) all do add a carriage return to show each piece on a separate line but all also add an open box character to the line.

Does anyone know how to get the carriage return inside the cell but without the open box character?

The ReplaceIt function shown in the code below just replaces single and double quotes.

Actual code:

'create fso objects
fso.CreateTextFile "e:\Webpages\Intern\excel\" & strFileName ' Create a file.
Set f = fso.GetFile("e:\Webpages\Intern\excel\" & strFileName)
Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)

'store db value in variable
strDepthAccum = chr(10) & ", " &objRSStand("strDepthCatDesc")

'write xml line later
with ts
.write "<Cell ss:StyleID=""Verdana""><Data ss:Type=""String""><![CDATA[" & ReplaceIt(strDepthAccum) & "]]></Data></Cell>" & vbcrlf
.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top