in reply to Password protection creating an Excel spreadsheet

Hi tariqahsan

The Spreadsheet::WriteExcel module has the protect() method which can be used to apply a password for worksheet protection:

$worksheet->protect('mysillypassword');.

N.B. From the the documentation:

"Note, the worksheet level password in Excel provides very weak protection. It does not encrypt your data in any way and it is very easy to deactivate. Therefore, do not use the above method if you wish to protect sensitive data or calculations. However, before you get worried, Excel's own workbook level password protection does provide strong encryption in Excel 97+. For technical reasons this will never be supported by Spreadsheet::WriteExcel."

Have a look at the documentation to see if it suits your other requirements.

Hope this helps.

Martin

Replies are listed 'Best First'.
Re^2: Password protection creating an Excel spreadsheet
by tariqahsan (Beadle) on Jan 10, 2006 at 21:25 UTC
    Thanks! Martin. I will try out the
    $worksheet->protect('mysillypassword');

    Tariq

Re^2: Password protection creating an Excel spreadsheet
by Dipak (Initiate) on Apr 28, 2011 at 05:11 UTC
    Hi Martin, I have created a excel sheet which contains 6 worksheets, 1: Contains data 2 - 6: Charts created using add_chart Here I dodnt have a handle for chart worksheet. How to protect all the 6 sheets ?

      Since this thread has been resurrected, it's probably worth putting in a pointer to a node I wrote in a similar, later thread: Re^4: Password Protect Excel File. Excel's internal protection is like a knee high fence. It's no more than a polite warning to the law abiding. Files can be properly secured so that they cannot be opened without the password, but sheet and project level protection is extremely weak and can be bypassed trivially. The link provided does not cover project level protection, but JFGI.

      Regards,

      John Davies