B
Bill Murphy
I have an Access 2002 query where I'm calling a function named fConcatChild
to return a concatenated text string which is somtimes greater than 255
characters in length. The query results are then exported to an Excel
spreadsheet using automation. The maximum cell width for displaying text in
Excel appears to be 255 characters, although I've received some promising
tips from the Excel forum concerning inserting manual line breaks in the
text in order to display more than 255 characters, and that 32,000
characters can actually be stored in a cell. I tried the code below, but so
far it appears I'm still getting only 255 characters displayed.
Any thoughts would be appreciated.
Bill
_________________________________________________________
I'm having trouble inserting a manual line break in my text, so I must have
a syntax problem. I'm doing this in a function named fConcatChild, and
returning the results to a query which is then exported to Excel using Excel
automation from within Access. Here's the code in my function:
' insert a hard return for display in Excel if the string is longer than
255
If Len(fConcatChild) > 255 Then
fConcatChild = Left(fConcatChild, 255) & vbCrLf &
Right(fConcatChild, Len(fConcatChild) - 255)
End If
I'm still getting only about 255 characters in the cell in Excel to which
this variable is exported. Am I using the wrong Visual Basic constant
vbCrLf?
Bill
to return a concatenated text string which is somtimes greater than 255
characters in length. The query results are then exported to an Excel
spreadsheet using automation. The maximum cell width for displaying text in
Excel appears to be 255 characters, although I've received some promising
tips from the Excel forum concerning inserting manual line breaks in the
text in order to display more than 255 characters, and that 32,000
characters can actually be stored in a cell. I tried the code below, but so
far it appears I'm still getting only 255 characters displayed.
Any thoughts would be appreciated.
Bill
_________________________________________________________
I'm having trouble inserting a manual line break in my text, so I must have
a syntax problem. I'm doing this in a function named fConcatChild, and
returning the results to a query which is then exported to Excel using Excel
automation from within Access. Here's the code in my function:
' insert a hard return for display in Excel if the string is longer than
255
If Len(fConcatChild) > 255 Then
fConcatChild = Left(fConcatChild, 255) & vbCrLf &
Right(fConcatChild, Len(fConcatChild) - 255)
End If
I'm still getting only about 255 characters in the cell in Excel to which
this variable is exported. Am I using the wrong Visual Basic constant
vbCrLf?
Bill