× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



After looking into this some more, I figured out why it will not work with xlsx.

I ran this command STRQSH CMD('javap -s org.apache.poi.ss.usermodel.Sheet > /tmp/sheetmth.txt) and protectsheet is not in our version

We are using /Java/poi3.6

Does someone have a method of updating to the latest POI version, which looks to be 5.0 now


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Steve M. Jones via RPG400-L
Sent: Friday, June 25, 2021 10:42 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Cc: Steve M. Jones <sjones@xxxxxxxxxxxxxxx>
Subject: protect a cell using HSSF/POI

I want to protect a cell in a .xlsx
I found an article from Scott Klement that does it for a xls, https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.easy400.net%2Fhssfcgi%2Fdocumentation%2F20100128.html&amp;data=04%7C01%7Csjones%40h-pproducts.com%7C8e1aafe6016e46675df708d937e77985%7C7bced1af2f3f4d99985ea8a4fce32fa5%7C0%7C0%7C637602289600976876%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=gJ3SIESOtd%2FRPMAuUAb7zbJZIFfCraZ9Gws0u2dc5OM%3D&amp;reserved=0

I thought I would just change the extProc to use the xlsx version and be good. My program fails when it tries to do the ssSheet_protectSheet

sheet = SS_newSheet(book: tabname);
password = new_String('secret');
ssSheet_protectSheet(sheet: password);

From reading the article, it seems as if I must set a password on the sheet to lock a cell. I tried to just lock the cell, but it still allows it to be changed.

row = SSSheet_createRow(sheet: rowcount);
ss_text(row: 0 : Abaitx:locked);

So I am missing something on the defining the extproc I assume, but I can not see what that is

Thanks in advance!!

Here is how I defined the extproc

d ssSheet_protectSheet...
d PR ExtProc( *Java
d : 'org.apache.poi.ss.usermod
d .Sheet'
d : 'protectSheet' )
d password like(jString) const

d ssCellStyle_setLocked...
d PR ExtProc( *java
d : 'org.apache.poi.ss.usermod
d .CellStyle'
d : 'setLocked' )
d locked 1n value <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.easy400.net%2Fhssfcgi%2Fdocumentation%2F20100128.html&amp;data=04%7C01%7Csjones%40h-pproducts.com%7C8e1aafe6016e46675df708d937e77985%7C7bced1af2f3f4d99985ea8a4fce32fa5%7C0%7C0%7C637602289600976876%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=gJ3SIESOtd%2FRPMAuUAb7zbJZIFfCraZ9Gws0u2dc5OM%3D&amp;reserved=0>
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&amp;data=04%7C01%7Csjones%40h-pproducts.com%7C8e1aafe6016e46675df708d937e77985%7C7bced1af2f3f4d99985ea8a4fce32fa5%7C0%7C0%7C637602289600976876%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Eq0KpimHMuCZq8yRMQaHQoQePl%2BLgZR1gRo5ltby0VQ%3D&amp;reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&amp;data=04%7C01%7Csjones%40h-pproducts.com%7C8e1aafe6016e46675df708d937e77985%7C7bced1af2f3f4d99985ea8a4fce32fa5%7C0%7C0%7C637602289600976876%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=pdlRilxx45ISQbfIDJ3%2BGdl4zpSAOibew%2Bd8vfzRw%2Bg%3D&amp;reserved=0.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com%2F&amp;data=04%7C01%7Csjones%40h-pproducts.com%7C8e1aafe6016e46675df708d937e77985%7C7bced1af2f3f4d99985ea8a4fce32fa5%7C0%7C0%7C637602289600976876%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=u2cvbDt5YXvbM4pS8R5oFhhacVaqM5eZUf3jGXhC0fk%3D&amp;reserved=0

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.