简体   繁体   中英

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?

I would be very happy if someone could help me.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM