No line breaks when writing cell in Excel?

Hi all,

  1. I need to grab a text field value from our in-house app, and store it as a string via Get Text (or similar). This string will likely include line breaks. Done.

  2. I then need to input that into an excel file, which I currently do via write cell - however, when I do this the line breaks are not inputted.

The line breaks are in the stored string, as if I display the stored string in a message box prior to trying to write the cell I can see the line breaks… But no breaks are shows in the Excel file.

Any ideas what I might be missing?


As one possibility, the string contains only CR as line break.
Can you try strData.replace(vbCr, vbLf) before write cell.