Recent

Author Topic: TsCellProtectionAction missing form the Standard Actions dropdown  (Read 3429 times)

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
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
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TsCellProtectionAction missing form the Standard Actions dropdown
« Reply #1 on: October 17, 2017, 05:25:21 pm »
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

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: TsCellProtectionAction missing form the Standard Actions dropdown
« Reply #2 on: October 18, 2017, 05:35:33 am »
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
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: TsCellProtectionAction missing form the Standard Actions dropdown
« Reply #3 on: October 19, 2017, 03:42:44 am »
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
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TsCellProtectionAction missing form the Standard Actions dropdown
« Reply #4 on: October 19, 2017, 09:48:26 am »
However, Worksheet (in my installation) doesn't include WriteCellProtection, am I missing something?
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.

Also which include file should I use to get the flags TsCellProtections?
In fpspreadsheet, all declarations are collected in unit fpstypes.

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: TsCellProtectionAction missing form the Standard Actions dropdown
« Reply #5 on: October 20, 2017, 03:30:01 am »
Hi wp,

Ah ok, I thought that was to the Actions.

Quote
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).

I've gone back to your link to the Trunk but all I get is 404 error.

Dave
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TsCellProtectionAction missing form the Standard Actions dropdown
« Reply #6 on: October 20, 2017, 08:48:24 am »
This is not a standard download link for the browser but for svn. You must use an svn client such as TortoiseSVN to get the files.

Or use this direct download link https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tarball, but it will download the entire ccr project from sourceforge as a zip file. After unzipping you should delete all folders that you don't need. Keep components/fpspreadsheet at least.

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: TsCellProtectionAction missing form the Standard Actions dropdown
« Reply #7 on: October 20, 2017, 09:09:09 am »
Many thanks #wp  :D
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

 

TinyPortal © 2005-2018