All,
I have this code:
$username="user";
$password="pass";
$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 = 1;
//open document
$excel->Workbooks->Open("http://$username:$password@www.website.com/files/$file[name]");
//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;
//echo "</td></tr></table>";
}
}
I want it to open excel and display the file that I had previously uploaded into a directory on my webserver. However when I run this it gives me the error: Fatal error: Cannot instantiate non-existent class: com in /home/web/public_html/viewinexcel.php on line 34
Can someone please help me out.