Hi,
There is a property in AdvGridImport that you can use:
AdvGridImport.ImportOptions.ResizeGrid := false;
After setting the property, set the number of rows in the grid to say 100 and try it. It should be faster.
Some other things to try:
1)
The FlexCelPreviewer component in FlexCel might be faster, since you don't have to import the file into a grid, it reads the values directly form the XlsFile object.
Try opening your file with the "Custom preview" demo (Demo\Delphi\Modules\25.Printing and Exporting\20.CustomPreview) and see if it is any faster.
While not shown in the Custom preview demo, you can also limit the number of rows and columns to display, by adding a print_area or by setting the PrintRangeRight/PrintRangeBottom properties in the FlexCelImageImport component attached to the FlexCelPreviewer.
2)If the preview doesn't work because you need a grid, you might want to try FlexCelGrid from FlexCel3 with XlsxAdapter so you can read xlsx and xls files. It should be faster than the filters again, because there is no "import" going on: the grid displays directly the cells in the XlsFile object.
If you want to try if this would be an option without needing to install FlexCel3, you can get an exe demo here:
3)The nuclear option: If times are crucial, the options above will make it faster but the XlsFile still needs to read and parse the whole file (which in xlsx can be not that fast). So if you just want a grid showing the numbers without much stuff like showing images and cell formats, you can use the "Virtual mode" to only load 100 rows and not the whole file.
You can try it with the demo:
Demo\Delphi\Modules\10.API\22.Virtual Mode
It has a checkbox to load only the first 50 rows, which of course is arbitrary, you can modify the demo to load 100. This option should be the fastest of all, because you stop reading the sheet in the file in the moment you have the data you want. The rest of the file is not read/parsed. It will use much less memory too. But it is also the most "bare bones" solution since it will just display the cells, no merged cells for example or images, or lots of other stuff. Depending on your case, it might be a compromise you can take because it doesn't matter to select the sheet.