spreadsheet.getActiveSheet().protect("1234"); if(spreadsheet.getActiveSheet().isProtected()){ System.out.println("This sheet can not be modified"); }
Related information
Protected property