SN

Hi there,

I am trying to make a cell in an Excel workbook hidden or locked but once got the output, I still could see and edit the cell in the output file. I was not sure if I had missed something. Below is my hopeless code.

Any idea would be most appreciated

Regards,

Sam

var oExcelWorkbook = Context.createExcelWorkbook("myexcel.xls");

//

var oSheet = oExcelWorkbook.createSheet("mysheet");

var oHeaderSet = oSheet.createRow(0);       



var oCell = oHeaderSet.createCell(i);

oXlsCellStyle = oCell.getCellStyle();

oXlsCellStyle.setAlignment(Constants.ALIGN_CENTER);

oXlsCellStyle.setHidden(true);

oXlsCellStyle.setLocked(true);

oCell.setCellStyle(oXlsCellStyle);

oCell.setCellValue("ABC");

oExcelWorkbook.write();

 

by Edwin Verstraeten
Posted on Mon, 03/26/2012 - 11:53

Hi Sam,

I can't tell about your version of excel, but in mine you first have to lock the the sheet before these settings have effect.....

Best regards,

Edwin

0
by Sam Nguyen Author
Posted on Mon, 03/26/2012 - 14:56

Thanks Edwin for your feedback.

My excel version is 2007. Could you be a bit more specific on how to lock the sheet in ARIS script?. I went through all of the methods of the XlsSheet object and could not seem to see a relevant method doing this.

Thanks,

Sam

0
by Edwin Verstraeten
Posted on Tue, 03/27/2012 - 12:06

Hi Sam,

You can use the method XlsSheet.setPasswordProtect(<password>).

If you don't need the password, you can use "", but then the end user can unprotect the sheet without password.

Success,

Edwin

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock