Jump to content

update excel file using php


sandhya

Recommended Posts

hi all,

 

I have a form with emailid textfield. I have to save that email id in an excel file every time the email id entered.I'm able to do it in text file. but i'm confused with excel file. any body can provide code for this? I"ll be so thankful.Thanks in advance.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.