VisibleInfosText vs GetResultValueAsString

1 Answer 86 Views
SpreadProcessing
y2kdis
Top achievements
Rank 1
y2kdis asked on 28 Feb 2022, 11:55 PM

Hi,

Which is the better way of getting the 'as displayed' cell value?


Dim selection As CellSelection = worksheet.Cells(i, j)
Dim value As ICellValue = selection.GetValue().Value
Dim format As CellValueFormat = selection.GetFormat().Value
Dim formatResult As CellValueFormatResult = format.GetFormatResult(value)
Dim result As String 

result = value.GetResultValueAsString(format)
'vs.
result =  formatResult.VisibleInfosText   

             

Thanks,

Sid

1 Answer, 1 is accepted

Sort by
0
Accepted
Tanya
Telerik team
answered on 02 Mar 2022, 10:17 AM

Hi Sid,

The two approaches are identical and you can use the one that most suits your preferences. Internally GetResultValueAsString() uses GetFormatResult() and VisibleInfosText to evaluate the value.

I hope this information is useful.

Regards,
Tanya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
SpreadProcessing
Asked by
y2kdis
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or