Programming > General

TsCellProtectionAction missing form the Standard Actions dropdown

(1/2) > >>

daveinhull:
Hi,

Unless I'm completely missing it, I can see the TsCellProtectionAction in the standard action dropdown in ActionList?

I'm currently using 1.8.2.0 although I've just seen (but not yet installed) 1.8.4.0 - has it been added to this  later version?

Also, I can see how to use this as an action for a button (I've done it with the merge action), but could someone give me a few ideas on how to protect cells from within code?

Many thanks
Dave

wp:
CellProtection is not yet released, you must switch to fpspreadsheet trunk to get it (use svn to download from https://svn.code.sf.net/p/lazarus-ccr/svn/fpspreadsheet, or download the snapshot of the entire ccr - use button "Download snapshot" - and delete everything except fpspreadsheet).

The documentation of the trunk version is always on the wiki: http://wiki.lazarus.freepascal.org/FPSpreadsheet#Protection.

Please be aware that fpspreadsheet does not encrypt files, it just sets the protection flags for cells / worksheets / workbooks so that the user is inhibited from changing the locked objects in the Office applications. Using fpspreadsheet it is still possibile to modify cells marked as being protected. In case of Excel 2007 files containing a password protected workbook, you also must install the new package laz_fpspreadsheet_crypto because Excel 2007 encrypts the file with this password although it should not. The needed decrypting function has been put into a separate package because it requires the DCPcrypt package.

You can have a look at spready (ccr/applications/spready) to see how protection features could be used in an application.

daveinhull:
Thanks @wp

Actually all I wanted to do is to stop the user 'accidentally' changing certain fields that I'm using as titles.

Will take a look at spready

Thanks

daveinhull:
Hi,

Just been looking at this and followed up on the documentation link.
However, Worksheet (in my installation) doesn't include WriteCellProtection, am I missing something?

Also which include file should I use to get the flags TsCellProtections?

Thanks

wp:

--- Quote from: daveinhull on October 19, 2017, 03:42:44 am ---However, Worksheet (in my installation) doesn't include WriteCellProtection, am I missing something?

--- End quote ---
Your installation has fpspreadsheet v1.8.2 - that's what you wrote in the first post. But I wrote in the second post that you need fpspreadsheet trunk for it.


--- Quote from: daveinhull on October 19, 2017, 03:42:44 am ---Also which include file should I use to get the flags TsCellProtections?
--- End quote ---
In fpspreadsheet, all declarations are collected in unit fpstypes.

Navigation

[0] Message Index

[#] Next page

Go to full version