Search string format ("*-*")


As per the patch and with the follwoing code i can able to search for a hardcoded string.

1) Can i able to search for a format of string like Excel provides us?
Dim currentCell as Cell = cells.FindString("-", previousCell, area)

2) Can i able to pass range as a parameter instead of cellarea in the findstring()
Dim currentCell as Cell = cells.FindString("-", previousCell, range)

This is a kind of important feature in out migration…pls help!!!

Code already received for reference

’ Search string in range from B2 to F11
Dim cells as Cells = ExcelObj.Worksheets(0).Cells
Dim area as CellArea
area.StartRow = 1
area.EndRow = 10
area.StartColumn = 1
area.EndColumn = 5

Dim previousCell as Cell = null
Dim currentCell as Cell = cells.FindString(“apples”, previousCell, area)

While Not currentCell Is Nothing
previousCell = currentCell
With currentCell.Style.Font
.Color = Color.Red
.IsBold = True
End With
currentCell = cells.FindString(“apples”, previousCell, area)
End While

Balaji RJ

  1. I don’t understand your need clearly. Could you please give me an example to show it?

    2. I can provide a new property to allow you to get CellArea from Range.


Lets say, i want to search for a particular string which has “-” in that from a particular range of cells.

Ex strings : “08P13-S9A-100”

MS Excel provides option to search thru all the values with has “-” in it using

sheetRange = Excel.Range.Find(-" , , Excel.XlLookAt.xlWhole, Excel.XlSearchOrder.xlByColumns, searchDirection, False, , )

- -> Search format.

Please let me know the equalant with Aspose.

-Balaji RJ


Currently you can use FindStringContains method to search such a string in a worksheet. I will provide a new method to enable you search it in a range.