note 52193 added to ref.com
| From: | bruce at yourweb dot com dot au | Date: | Sun, 24 Apr 2005 00:47:20 +0000 |
| Subject: | note 52193 added to ref.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88458@lists.php.net to get a copy of this message | ||
Simple convert xls to csv
<?php
// starting excel
$excel = new COM("excel.application") or die("Unable to instanciate excel");
print "Loaded excel, version {$excel->Version}\n";
//bring it to front
#$excel->Visible = 1;//NOT
//dont want alerts ... run silent
$excel->DisplayAlerts = 0;
//open document
$excel->Workbooks->Open("C:\\mydir\\myfile.xls");
//XlFileFormat.xlcsv file format is 6
//saveas command (file,format ......)
$excel->Workbooks[1]->SaveAs("c:\\mydir\\myfile.csv",6);
//closing excel
$excel->Quit();
//free the object
$excel->Release();
$excel = null;
?>
----
Manual Page -- http://www.php.net/manual/en/ref.com.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52193
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52193&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52193&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52193&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52193&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52193&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52193&report=yes
Search -- http://master.php.net/manage/user-notes.php