本文介绍使用spire.xls for java在excel中设置接受或者拒绝修订的方法。
import com.spire.xls.*;
public class acceptorrejectchanges {
public static void main(string[] args) {
//加载excel文档
workbook workbook = new workbook();
workbook.loadfromfile("test.xlsx");
//判断是否有修订
if(workbook.hastrackedchanges())
{
//接受所有修订
workbook.acceptalltrackedchanges();
//拒绝所有修订
//workbook.rejectalltrackedchanges();
}
//保存文档
workbook.savetofile("result.xlsx", fileformat.version2013);
workbook.dispose();
}
}