Reading Excel Merged Cells

Started by oradba4u, January 05, 2022, 10:23:40 PM

Previous topic - Next topic

oradba4u

All:
Does anyone have experience reading Excel merged cells using WinBatch? I'm trying to read text and all I get back is the value 28.0 (whatever that means)
No matter where I click in the merged cells in Excel, It always tells me that I'm in the upper-left most cell of the group (that makes sense), but I get this strange number (28.0) back when I go to that cell and perform a read:

TheCell=oWS.Cells(RowNum,ColNum)
WholeStr=TheCell.value
Message("The cell value is:",WholeStr)

Also, can all the lines of the merged cells be read as one value (WinBatch variable) crlf included, as if it's a paragraph with many lines?

Any suggestions would be greatly appreciated

stanl


you can try

Code (WINBATCH) Select


TheCell=oWS.Cells(RowNum,ColNum)
V = TheCell.MergeArea.Cells(1, 1).Value

stanl

Quote from: oradba4u on January 05, 2022, 10:23:40 PM
Also, can all the lines of the merged cells be read as one value (WinBatch variable) crlf included, as if it's a paragraph with many lines?


Would have to see an example of what you are talking about. Putting lf or crlf in Excel cells is really dangerous, especially if data is exported as text. Long text is best suited for word-wrap or text box.