Page 1 of 1

IT2BE Data Plugin Protect Excel sheet

PostPosted: Wed Oct 21, 2020 10:38 am
by briese-it
I want to protect a created excel sheet but how top protect it with a password?

I can protect a sheet with:
var workbookTemplate = excelObject.readWorkBook("d:\filename.xls");
var workSheet1 = workbookTemplate.getWorkbook().getWorksheets().get(1);
workSheet1.protect(1);
protect has arguments (arg0,arg1) but I can't find a description how to use it.
Any ideas?

Re: IT2BE Data Plugin Protect Excel sheet

PostPosted: Thu Oct 22, 2020 8:33 pm
by sbutler
Its the type and password. Type should be 0 by default. so...

Code: Select all
workSheet1.protect(0, "thePassword");


For faster support on IT2BE components, use the official support channel: http://servoycomponents.com/support