× 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.



I want to protect a cell in a .xlsx
I found an article from Scott Klement that does it for a xls, https://www.easy400.net/hssfcgi/documentation/20100128.html

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://www.easy400.net/hssfcgi/documentation/20100128.html>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.