Exporting memo fields to Excel via VBA

TUSSFC

Registered User.
Local time
Today, 14:05
Joined
Apr 12, 2007
Messages
57
I've got some VBA code to build an Excel file on the fly and generate with data from my access tables.

The code breaks when I try to export a memo field which is too long (haven't had time to character count yet - I'm thinking its over 256. I've made the data small to test and it works fine (e.g. 50 chars).

Code:
                                With XLApp.Selection
                                    .Value = rsA("Action_Updates")
                                    .WrapText = True
                                    .Borders(xlDiagonalDown).LineStyle = xlNone
                                    .Borders(xlDiagonalUp).LineStyle = xlNone
                                    With .Borders(xlEdgeLeft)
                                        .LineStyle = xlContinuous
                                        .Weight = xlThin
                                        .ColorIndex = xlAutomatic
                                    End With
                                    With .Borders(xlEdgeTop)
                                        .LineStyle = xlContinuous
                                        .Weight = xlThin
                                        .ColorIndex = xlAutomatic
                                    End With
                                    With .Borders(xlEdgeBottom)
                                        .LineStyle = xlContinuous
                                        .Weight = xlThin
                                        .ColorIndex = xlAutomatic
                                    End With
                                    With .Borders(xlEdgeRight)
                                        .LineStyle = xlContinuous
                                        .Weight = xlThin
                                        .ColorIndex = xlAutomatic
                                    End With
                                End With

I knew there was an issue with exporting large memo fields to Excel ... but thought this was related to using the export option within Access rather than writing to Excel via VBA.

Can anyone advise of a workaround. The field contains "Action Updates" which, by their very nature may be long. Therefore I need to be able to do this. Thanks.
 
A workaround I've gone for is creating another "Action_Updates" table ... instead of having x number of updates in a single memo field - I have a record for each update in a relational table.

It was probably the method I should have used anyway.

In any case ... I'd still be interested in knowing if there is a "fix" for the above ..
 

Users who are viewing this thread

Back
Top Bottom