Results 1 to 5 of 5

Thread: Pathways to an Excel file - PHP

  1. #1
    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.

  2. #2
    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

  3. #3
    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

  4. #4
    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.

  5. #5
    Join Date
    Mar 2008
    Posts
    232

    Re: Pathways to an Excel file - PHP

    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

Similar Threads

  1. Replies: 6
    Last Post: 17-02-2012, 01:18 PM
  2. Excel 2007 file fails to get permission to open in Excel 2011
    By Raju Chacha in forum Windows Software
    Replies: 6
    Last Post: 13-01-2012, 09:17 PM
  3. Replies: 5
    Last Post: 13-01-2012, 05:18 PM
  4. Replies: 4
    Last Post: 13-02-2011, 10:37 AM
  5. Replies: 4
    Last Post: 07-05-2009, 02:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,394,775.16411 seconds with 16 queries