Darren I tried your suggestion about setting the column width before calling AutoFit(), to no avail. I did the same with RowHeight, again to no avail.
Paul -----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Darren Sent: 13 September 2013 13:54 To: [email protected] Subject: RE: Strange Excel behaviour Paul this is a bit of code in my excel export that deals with memo's and the comments I put in at the time (it was a good 10 years ago when I did this). I seem to recall that autofit does (or didn't) work properly with multiple lines so I took to setting the width and height (later) to larger than needed values and then calling autofit. That did the trick for me. *- Autofit the memo field columns *- Set the width to 100 and then autofit will bring it in if it needs to be. *- Autofit will not bring the width out appropriately. IF lafldsout(m.lnfld, 6) = 0 && Memo lcCol = spnCol2cCol(m.lnfld) loSheet.COLUMNS(m.lcCol + ":" + m.lcCol).SELECT loSheet.COLUMNS(m.lcCol + ":" + m.lcCol).COLUMNWIDTH = 100 loExcel.SELECTION.COLUMNS.autofit ENDIF -----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul Newton Sent: Friday, 13 September 2013 10:44 PM To: [email protected] Subject: RE: Strange Excel behaviour Thanks for your suggestions, Darren. I have tried them all to no avail :( -----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Darren Sent: 13 September 2013 13:39 To: [email protected] Subject: RE: Strange Excel behaviour Paul a few things I found dealing with excel. 1. No need for CHR(13) 2. Use autofit ... Set loRange to the entire sheet loRange.COLUMNS.autofit loRange.ROWS.autofit -----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul Newton Sent: Friday, 13 September 2013 10:25 PM To: [email protected] Subject: Strange Excel behaviour Hi all I am using automation to populate cells in Excel. Some of the text in the cells consists of two lines, e.g. "Fred" + CHR(10) + CHR(13) + "Flintstone". When I open the spreadsheet it appears in the cell as "FredFlintstone" but it shows as two lines in the formula bar. If I click in the formula bar and then click anywhere in the spreadsheet it appears in the cell correctly. Any ideas how to get around this? Many thanks Paul Newton [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

