2022 Dec 28 10:54 AM
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.
2022 Dec 28 3:05 PM
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.
2022 Dec 28 3:05 PM
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.
2022 Dec 29 12:46 AM