G
Guest
Hi,
I'm trying to save just ONLY one sheet from a work book to with many sheet's to a new htm(l) file.
But with the following code, it saves all the sheets and just defaults to the one sheet when the htm file is opened, but all sheets are there and visible and can be selected.
Any help would be appreciated.
Thanks in andvance,
-Randy W
$excel = new COM("Excel.Application") or die('...');
$excel -> Workbooks -> Open($file);
$book = $excel -> Workbooks(1);
$sheet = $book -> Worksheets(1);
$newfilename = getcwd()."\graph.htm";
$sheet -> SaveAs($newfilename,44); // <- trying to save just one sheet as htm file.
$book -> Close(true);
unset($sheet);
unset($book);
$excel -> Workbooks -> Close();
$excel -> Quit();
I'm trying to save just ONLY one sheet from a work book to with many sheet's to a new htm(l) file.
But with the following code, it saves all the sheets and just defaults to the one sheet when the htm file is opened, but all sheets are there and visible and can be selected.
Any help would be appreciated.
Thanks in andvance,
-Randy W
$excel = new COM("Excel.Application") or die('...');
$excel -> Workbooks -> Open($file);
$book = $excel -> Workbooks(1);
$sheet = $book -> Worksheets(1);
$newfilename = getcwd()."\graph.htm";
$sheet -> SaveAs($newfilename,44); // <- trying to save just one sheet as htm file.
$book -> Close(true);
unset($sheet);
unset($book);
$excel -> Workbooks -> Close();
$excel -> Quit();