PHP
  Home arrow PHP arrow Page 2 - PHP and COM
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

PHP and COM
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 10
    2002-04-23

    Table of Contents:
  • PHP and COM
  • Striving To Excel
  • The Number Game
  • Export Potential
  • Keeping It Simple
  • Access-ing The Web
  • All For One, And One For All
  • New Coins For Old
  • Link Zone

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    PHP and COM - Striving To Excel


    (Page 2 of 9 )

    Since COM is a Microsoft invention, it won't surprise you to hear that PHP's COM extension is only available for the Windows version of PHP. If you're using *NIX - well, you're outta luck. Shut down your browser and read a book instead.

    If you're still interested, though, pop open your favourite editor and create a PHP script containing the following lines of code (this example assumes that you have a properly-installed copy of Microsoft Excel on your system):

    <?php // create an object instance $excel = new COM("Excel.Application") or die("Excel could not be started"); // pop open the Excel application $excel->Visible = 1; // turn off alerts $excel->DisplayAlerts = 0; // add a workbook $excel->Workbooks->Add(); // save $excel->Workbooks[1]->SaveAs("C:\\Inventory.xls"); // close the application $excel->Quit(); $excel = null; ?>
    Now, when you run this script through your Web browser, the following things should happen very fast:

    1. Microsoft Excel will start up automatically.

    2. A new workbook will be added.

    3. The workbook will be automatically saved as "C:\Inventory.xls"

    4. Microsoft Excel will automatically shut itself down.

    Wondering how this happened? Keep reading!

    More PHP Articles
    More By Harish Kamath, (c) Melonfire


     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway