IT2BE Data Plugin Protect Excel sheet

Questions and answers on developing, deploying and using plugins and JavaBeans

IT2BE Data Plugin Protect Excel sheet

Postby briese-it » Wed Oct 21, 2020 10:38 am

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?
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2021.3.0.3642 Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 155
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany

Re: IT2BE Data Plugin Protect Excel sheet

Postby sbutler » Thu Oct 22, 2020 8:33 pm

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
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 728
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 4 guests