O
O
Oleg Seledets2018-06-27 23:32:45
Qt
Oleg Seledets, 2018-06-27 23:32:45

How to implement filtering in Excel via Qt?

Hello, I am displaying a table from TableView in excel.
I set up everything, both borders and color and hyphenation, but I can’t fasten filtering to the first line, each filled cell.
As I understand it, do everything as in this case:

QAxObject *font=cell->querySubObject("Font");
        font->setProperty("Color",QColor("blue"));

This is an example for font color.
VBA for Excel says there are objects and their properties. Here is an example of one of the many properties of an object.
CellFormat object
  • Font property

How then to implement the filter on a cell. I think something like this, but then what to write instead of ???
QAxObject *filter=cell->querySubObject("Filter");
        filter->setProperty("???",  ???  ));

these are the properties that the filter
object has. Filter object
  • Application property
  • Count property
  • Creator property
  • Criteria1 property
  • Criteria2 property
  • On property
  • Operator property
  • Parent Property

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Seledets, 2018-06-28
@oleja1ee7

Everything was solved simply in this way
QAxObject *filter = cell->querySubObject("AutoFilter");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question