Jump to content

update excel file using php


sandhya

Recommended Posts

Hi  Siric & Mchl,

 

Thanks for your reply.and i have a doubt.so, Is it not possible to add email id directly to excel file every time the form submitted?

 

Actually I"ll create an excel file first. and later that file should be updated with the email id in the next row each time the form submitted.

 

It is possible. For example to insert data into a cell using COM object you would do this:

 

$excel = new COM("Excel.sheet");
$workbook = $excel->application->Workbooks->Open('filename.xls');
$worksheet = $workbook->Worksheets('sheetName');
$worksheet->Cells($row,$column)->value = 'put your value here';
$excel->application->ActiveWorkbook->Close(false);

 

You need to do this on Windows and have Excel installed. It's also terribly slow (as it basicaly starts Excel in background).

For small Excel files using a library like phpExcel  is probably a better choice.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.