B
Bernie Yaeger
I'm using the following function (I'm displaying the guts of it only) to
convert a datatable to an excel spreadsheet:
For Each mrow In dt.Rows
rowindex += 1
colindex = 0
For Each col In dt.Columns
colindex += 1
objws.Cells(rowindex, colindex) = mrow(col.ColumnName).ToString()
Next
Next
It works fine; however, when I convert columns with carriage returns in
them, the row does not wrap inside Excel; instead, you end up with a very
long (verticle) column. Inside Excel, even columns/autofit selection has
not effect. The entire spreadsheet, therefore, looks distorted. Is there
any way to strip out chr(10) + chr(13) from the data?
Thanks for any help.
Bernie Yaeger
convert a datatable to an excel spreadsheet:
For Each mrow In dt.Rows
rowindex += 1
colindex = 0
For Each col In dt.Columns
colindex += 1
objws.Cells(rowindex, colindex) = mrow(col.ColumnName).ToString()
Next
Next
It works fine; however, when I convert columns with carriage returns in
them, the row does not wrap inside Excel; instead, you end up with a very
long (verticle) column. Inside Excel, even columns/autofit selection has
not effect. The entire spreadsheet, therefore, looks distorted. Is there
any way to strip out chr(10) + chr(13) from the data?
Thanks for any help.
Bernie Yaeger