Current location: Hot Scripts Forums » Programming Languages » PHP » Excel Reading, PHP On Windows


Excel Reading, PHP On Windows

Reply
  #1 (permalink)  
Old 08-16-04, 02:16 PM
zicon zicon is offline
New Member
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Excel Reading, PHP On Windows

Hi,

currently I have PHP running on a windows box (dont ask hehe), basically I have PHP code that "should" be able to read from an excel file.

This is a production box so it has PHP installed, mySQL etc etc ASP /.NET.

Do i need OFfice installed for PHP to be able to read the file?

Or is there something im missing, i've also read somewhere that this shud be enabled by default on Windows PHP installations.

Any help is greatly appreciated.

Wont mean much, but the sorta error im getting is : Did not instantiate Excel

Code:
<?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("D:\\domains\\daniber.com\\wwwroot\\includes\\Test1.xls");

// close the application
$excel->Quit();

$excel = null;

?>

Last edited by zicon; 08-16-04 at 02:20 PM.
Reply With Quote
  #2 (permalink)  
Old 08-17-04, 06:47 PM
zicon zicon is offline
New Member
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Anyone?
Reply With Quote
  #3 (permalink)  
Old 08-18-04, 03:39 AM
mikaelf mikaelf is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: php[dot]net
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
yep, you have to install microsoft excel first. note, COM is short for Component Object Model. if you need php to deal with excel, of course you have to have Ms. Excel installed on your winserver, don't you?
__________________
Useful PHP links:
bugs.php.net - for reporting PHP bugs
pear.php.net - PHP extension and application repository
pecl.php.net - get non standard PHP modules, submit yours
www.phpclasses.org - PHP classes repository
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php with Apache in windows eDevil PHP 3 08-08-04 12:03 AM
Reading .lnk file(shortcut files in windows) anupamsr PHP 5 04-22-04 02:42 PM
PHP - Windows Authentication link Mista Script Requests 3 12-29-03 06:09 PM
Proven PHP Script not working on Windows 2000 server – any ideas? chimchim PHP 5 11-13-03 09:16 PM
writing Excel files through PHP pk_jsp PHP 4 09-28-03 05:42 AM


All times are GMT -5. The time now is 04:20 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.