tags:

views:

138

answers:

2

Hello ,

Is it possible to delete rows in excel sheet using PHP ?

Can anyone guide me.

Regards, Mithun

+1  A: 

If it's Excel 2007 you can take a look at http://www.phpexcel.net

brendan
+2  A: 

Only works if your PHP is hosted under Windows.

This should be a good start if PHPExcel* doesn't work.


Open

$this->excel = new COM("Excel.sheet") or $this->error("error");
$this->workbook = $this->excel->application->Workbooks->Open($path) or $this->error("error");

Close

$this->excel->application->ActiveWorkbook->Close("False");
unset($this->workbook);
unset($this->excel);

*I've never used PHPExcel, but it doesn't look bad

r3zn1k
Excellent solution, but it's important to note that this code requires a Windows hosted PHP; it won't work on Linux/UNIX (Mac?).
Tony Miller