What does LookInType means?

At this page: Enum LookInType | Aspose.Cells for .NET API Reference

What does the below line means?

If the cell contains a formula, find it from formula. Else find object from the formula.

It makes no sense to me and neither of my colleagues.

The reason I need this information is that, I want to find something which can be three of the below LookInTypes:

  • OnlyFormulas
  • Comments
  • Values or OriginalValues

I don’t want to process the file in three steps, what can I do to solve this?

bool asd = true;
findOptions.LookInType = asd ? LookInType.Values : LookInType.OriginalValues;
SearchInCells(cells, searchTerm, findOptions);

findOptions.LookInType = LookInType.OnlyFormulas;
SearchInCells(cells, searchTerm, findOptions);

findOptions.LookInType = LookInType.Comments;
SearchInCells(cells, searchTerm, findOptions);

Can I somehow do it in one yield?

@sohi,
Thank you for your query.

We have reviewed this information and soon will rephrase it to make it more understandable.

Regarding your second query, I am afraid that there is no such option which can be used to find data with the multiple LookInTypes. If you try this scenario in MS Excel, it also does not allow finding information in this way. Try it in MS Excel and if you find some way, please share the steps with us. We will try to provide you with assistance using Aspose.Cells to achieve the same functionality.

Thank you @ahsaniqbalsidiqui !

Can you please elaborate a little bit more on the this?

Try it in MS Excel and if you find some way, please share the steps with us. We will try to provide you with assistance using Aspose.Cells to achieve the same functionaality.

Do you mean that I should try to use Excel desktop application to reach the above described search case?
For example:

  1. open excel application
  2. Hit control + f
  3. type a search term

And if I can find data in comments, values, and formulas, then you can help me to the same in my program?

@sohi,
If you look into the attached image, only one option can be selected at a time. It shows that MS Excel does not allow all the options to be used simultaneously. You may please give it a try and share the feedback. Please note that as Aspose.Cells mimics the behaviour of MS Excel, so it also does not allow multiple options at a time.

Find And Replace.png (9.1 KB)

Regarding the description of LookInType in the API reference, following is the correct description:

If the cell contains a formula, find it from formula,else find object from the value.

Thank you @ahsaniqbalsidiqui!

It’s all clear now :slight_smile:
I will give it a try, and report back.

@sohi,

You are welcome.