import
java.io.File;
import java.io.IOException;
import jxl.SheetSettings;
import jxl.Workbook;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
public class TestPassword {
public static void main(String[] args) throws IOException, WriteException {
WritableWorkbook wwb = Workbook.createWorkbook( new File( " d:/test.xls " ));
WritableSheet ws = wwb.createSheet( " Test Sheet 1 " , 0 );
SheetSettings ss = ws.getSettings();
ss.setPassword( " 12345678 " );
ss.setProtected( true );
wwb.write();
wwb.close();
}
}
import java.io.IOException;
import jxl.SheetSettings;
import jxl.Workbook;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
public class TestPassword {
public static void main(String[] args) throws IOException, WriteException {
WritableWorkbook wwb = Workbook.createWorkbook( new File( " d:/test.xls " ));
WritableSheet ws = wwb.createSheet( " Test Sheet 1 " , 0 );
SheetSettings ss = ws.getSettings();
ss.setPassword( " 12345678 " );
ss.setProtected( true );
wwb.write();
wwb.close();
}
}