Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-01-2009
Member
 
Join Date: Dec 2008
Posts: 202
Pathways to an Excel file - PHP

Hello,

I try to browse a php file to insert a mysql database. (to make dynamic pages from the database after). And I started by searching on the net, and the only book I found that can generate Excel files with php, so in that sense too

I wonder if this is possible (by browsing the file directly xls ca can not walk because of the binary)

And if not, there is the option of using Microsoft COM objects (my server is on windows) to interact with Excel. But I've never used COM, and I am not sure how it works.

So I want to summarize retrieve data from an Excel file. Can you help please.
Reply With Quote
  #2  
Old 19-01-2009
Member
 
Join Date: Mar 2008
Posts: 227
Re: Pathways to an Excel file - PHP

In Excel: Save As \ File type: CSV

Look what it gives you, you should have less difficulty
Reply With Quote
  #3  
Old 19-01-2009
Member
 
Join Date: Dec 2008
Posts: 202
Re: Pathways to an Excel file - PHP

Yeah, I know this solution is obvious that it would be more practical to go through.

But I'd like to do it without the user must save the file every time. (I'm working for an intranet, there's a lot of files to manage and people are disabled :-()

That's why I was looking for a PHP ONLY.

But thank you
Reply With Quote
  #4  
Old 19-01-2009
Member
 
Join Date: Mar 2008
Posts: 227
Re: Pathways to an Excel file - PHP

Arf, PHP ONLY, I do not see how in this case ...

As against a macro in Excel, which saves the file in the right format, possibly with the addition of a button in the menu bar to call this macro, it is very doable ...

A large button which is 10 cm by 5 is not User Friendly.
Reply With Quote
  #5  
Old 19-01-2009
Member
 
Join Date: Mar 2008
Posts: 232
Re: Pathways to an Excel file - PHP

Quote:
C reading a bit like writing for only open at the beginning ...
But try to access data are the same.

$ excel = new COM ( "Excel.Application"); / / Open connection to Excel

$ workbook = $ excel-> Workbooks-> Open ($ filename);
/ / Name of the file to open: absolute

/ / I selected to read the paper (the numbering starts leaves 1
$ sheet = $ workbook-> Worsheets ($ no_feuille);

/ / To read a cell eg A1 ...

/ / I select:
$ cell = $ sheet-> Range ( "A1");

/ / I do its contents:
echo $ cell-> value;

/ / I close the document

/ / If Excel is the head because it did not saved
/ / $ File-> save ();

$ workbook-> close ();

/ / I close excel
$ excel-> Workbooks-> close ();
$ excel-> Quit ();

/ / And we do unset all variables that controls
otherwise there is good tutorial on W3Schools.com
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Pathways to an Excel file - PHP"
Thread Thread Starter Forum Replies Last Post
Getting Error while opening Microsoft Excel 2000 file in Excel 2003 AbiaA MS Office Support 6 17-02-2012 01:18 PM
Excel 2007 file fails to get permission to open in Excel 2011 Raju Chacha Windows Software 6 13-01-2012 09:17 PM
Need help to import a Microsoft Excel file to semicolon delimited text file Roch Windows Software 5 13-01-2012 05:18 PM
Configuring Internet Explorer 8 to open Excel file in to Microsoft Excel Aaghaz Technology & Internet 4 13-02-2011 10:37 AM
Unable to access linked Excel file from shared Excel file on server AK_Chopra Windows Software 4 07-05-2009 02:09 PM


All times are GMT +5.5. The time now is 12:19 AM.