'Change Sheet in Excelfile using SmartXls

I´m using SmartXLS for Java(5.7.1) to do some calculations in Excel.

Does anyone have experience with SmartXLS?

There are 5 worksheets in my file and I want to edit sheet 2. How am I able to select a specific sheet or how can I select a specific sheet and manipulate its contents?



Solution 1:[1]

So i found a way to solve my Problem.

This way it works:

        for (int s = 0; s < getWorkBook().getNumSheets(); s++) {
        if (s == 1) {
            getWorkBook().setSheet(s);
            ... do some stuff ...
            }
        }
    }

In this case (s == 1) represents sheet number 2.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1