Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

DOI: how to append value to a cell

0 Kudos
388

hi,experts.

The object "i_oi_spreadsheet" has two method "insert_range_dim" and "set_ranges_data" which can add value to a cell. But when I write value to a cell, it override the original value.

How can I append a value to a cell instead of override it? Just like the two picture below, append "123456" to the cell.

Thank you.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
303

INSERT_RANGE_DIM and SET_RANGES_DATA both set a value in a cell, they don't append text to the current text.

There's no other method to do that.

You'd better make your Excel file such a way that "PI No" and "123456" are in two different cells.

If you can't, you can get the value (GET_RANGES_DATA and so on), append text, and then set the cell value, but you will lose the mixed character formatting ("PI No" as bold, "123456" as not bold).

If you want to set a cell value with mixed character formatting, you can still execute direct OLE commands in Excel, but it's much complex, and I don't have time to explain how to do it.

2 REPLIES 2

Sandra_Rossi
Active Contributor
0 Kudos
304

INSERT_RANGE_DIM and SET_RANGES_DATA both set a value in a cell, they don't append text to the current text.

There's no other method to do that.

You'd better make your Excel file such a way that "PI No" and "123456" are in two different cells.

If you can't, you can get the value (GET_RANGES_DATA and so on), append text, and then set the cell value, but you will lose the mixed character formatting ("PI No" as bold, "123456" as not bold).

If you want to set a cell value with mixed character formatting, you can still execute direct OLE commands in Excel, but it's much complex, and I don't have time to explain how to do it.

0 Kudos
303

Thank you. I would like to split the cell into two columns