Prev
ExploreString
ExcelExplorer Manual Next
WorksheetsNum


ExcelExplorer::ExploreWorksheet

(ExcelExplorer 4.0)

Read data from a specified worksheet.

integer ExploreWorksheet( integer $worksheet )
Parameters
integer $worksheet
Zero-based worksheet number (first sheet - 0, second - 1, and so on).
 
Description

This method is useful when you need to read data from several worksheets but not from all. Typical usage is to call ExploreFile() or ExploreString() method with explore_sheet option is set and after that use this method for other sheet(s) that need to be readed. The advantage of using this method is that it will not explore the whole file again - therefore it will works much faster.

Notes
  • You can use ExploreWorksheet only after successfully call to ExploreFile() or ExploreString().
  • No worksheet data will be readed and EE_OK result code will be returned if file have been explored with read_filter set without EE_READ_SHEETSDATA.

Returns one of the following values that indicate if file contents explored successfully or not:

Error code Description
EE_OK Exploring done without error.
EE_INVFILE File corrupted or not in Excel 5.0 and above format.
EE_INVVER Unknown Excel file version.

Read data from first, second and fourth worksheets


<?php


  
// read data from the first sheet
  
$ee->ExploreFile($filename,array('explore_sheet' => 0));

  
// ... working with readed data

  
$ee->ExploreWorksheet(1); // read data from the second sheet

  // ... working with readed data

  
$ee->ExploreWorksheet(3); // read data from the fourth sheet

  // ... working with readed data

?>

 
Prev
ExploreString
Home
Up
Next
WorksheetsNum

 
© 2002-2009 EEPHP.com
All Rights Reserved.