breakdown and debug with the likes of:
For r = 5 To .Cells(.Rows.Count, "A").End(xlUp).Row
lcol = .Cells(r, 256).End(xlToLeft).Column
Application.Goto .Range("A" & r).Resize(, lcol)
x = Application.Transpose(.Range("A" & r).Resize(, lcol))
x = Application.Transpose(x)
x = Join(x, ",") 'bombs out here when only one cell.
wline = wline & Join(Application.Transpose(Application.Transpose(.Range("A" & r).Resize(, lcol))), ",") & vbNewLine
Next r
then when you find out what's wrong you may be doing the likes of:
For r = 5 To .Cells(.Rows.Count, "A").End(xlUp).Row
lcol = .Cells(r, 256).End(xlToLeft).Column
x = Application.Transpose(Application.Transpose(.Range("A" & r).Resize(, lcol)))
If IsArray(x) Then x = Join(x, ",")
wline = wline & x & vbNewLine
Next r