Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel es.setsell removes line breaks/carriage returns
#1
A variable holds text paragraphs containing line breaks. I wish to output that variable into excel using es.setcell. However, the result has no line breaks. Setcell removes them. Is there a fix for this? Thanks.
#2
Macro Macro1021
Code:
Select All      Help
ExcelSheet es.Init
es.SetCell("aaa[]bbb" "C3")
#3
Unfortunately, I can't use that since I need the text is held in a variable. Is there another option?
#4
Macro Macro1021
Code:
Select All      Help
ExcelSheet es.Init
str variable="aaa[]bbb"
es.SetCell(variable "C3")
#5
Here is my code. The variable is a random piece of information that constantly changes. It's not something that I can manually set.
Code:
Select All      Help
str textvariable

;;pdf editor
int w3=act(win("" "PXE:{C5309AD3-73E4-4707-B1E1-2940D8AF3B9D}"))

textvariable.getsel

int w1=act(win("" "XLMAIN"))
ExcelSheet es.Init
es.Activate(4) ;;activate Excel

es.SetCell(textvariable 1 1)
#6
If textvariable contains newlines and Excel removes them, look in Excel Options or google how to set Excel to not remove newlines, I don't know.
#7
Ok. Thanks for trying.
#8
Maybe these line breaks are nonstandard. For example my Excel removes single CRs.

Macro Macro1023
Code:
Select All      Help
str textvariable
textvariable="line[]line" ;;standard
outb textvariable textvariable.len 1
textvariable="line[13]line" ;;nonstandard
outb textvariable textvariable.len 1


Forum Jump:


Users browsing this thread: 1 Guest(s)