About Aspose.Cells.GridDesktop.GridDesktop.ImportExcelFile()

“gridDesktop1.ImportExcelFile(dataDir + “Sample.xlsx”)” is no problem .
I see there is three sheets in Sample.xlsx, so I try to change this sentence to “gridDesktop1.ImportExcelFile(dataDir + “Sample.xlsx”, 1)”.I want to load only one of the worksheets but failed, and I can’t see any error messages.
Thank you.

@Engineer_Liu,
Please share your sample file with us for our testing. We will reproduce the problem and provide our feedback after analysis.

Sample.zip (8.4 KB)
The sample I use is included in the product, and my version is 18.11.0.0. Maybe it is too old?

Sorry, my Aspose.Cells.GridDesktop.dll is 17.7.0.0

@Engineer_Liu,

Thanks for the template file.

In Aspose.Cells.GridDesktop, the sheets are zero-based indexed. So, kindly change your line of code:
i.e.,

gridDesktop1.ImportExcelFile(dataDir + “Sample.xlsx”, 1)

to:

gridDesktop1.ImportExcelFile(dataDir + “Sample.xlsx”, 0)

it will work fine to get the first worksheet into grid matrix.

Hope, this helps a bit.