Hey all,

Any one use the PEAR Spreadsheet_Excel_Writer package?

I need to know how to implement the setLocked method to lock out a cell, but can't figure out how this would be done.

Do you add it as a format? But then how is it applied to a cell. It's not documented on the PEAR pages.

Any help as always is greatly appreciated.

Also, what about making a cell span more than one cell below and above it? I can't find a way to do this either.


I've used it for some time but never needed to lock a cell. Here is a piece of code that shows how to apply a format to a cell:

// Include the PEAR script
require 'Spreadsheet/Excel/Writer.php';

// Stop displaying the errors so that the warnings don't get in your spreadsheet
// ini_set('display_errors',0);

// Instantiate a workbook
$workbook = new Spreadsheet_Excel_Writer();

// Send it directly to the browser

// Set the version (very useful for compatibility)

// Create a worksheet in the workbook
$worksheet =& $workbook->addWorksheet('Test');

// Set input encoding

// Create a format
$format_bold =& $workbook->addFormat();

// Apply the format to a cell
$worksheet->writeString(0, 0, "Test content", $format_bold);

// Close the workbook

Hope it helps. I think that by doing something like this:


while creating the format could do the trick but it is not tested.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to