Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: How To Get the sheet names?

$
0
0
Massi wrote:
you can also use
$objReader->listWorksheetNames($file);
to get an array of all sheet names in the file
That's it! I find it easier using this.
Now My codes are:
$sheets = $read->listWorksheetNames($filepath);
foreach($sheets as $sheetname){
    switch ($sheetname)
            {
                case 'A':
                    $_sheet = $excel->setActiveSheetIndexByName($sheet);
                    $this->do_A($_sheet);
                        break;
                case 'B':
                    $_sheet = $excel->setActiveSheetIndexByName($sheet);
                    $this->do_B($_sheet);
                break;
                case 'C':
                    $_sheet = $excel->setActiveSheetIndexByName($sheet);
                    $this->do_C($_sheet);
                break;
                                default:
                        $this->do_D();
                break;
}
Thank you again for giving me a hint how to do it quickly and better.

@LWol
Thank you for the responses,
After an hour of writing codes finally the codes are done...

Thank you all

Viewing all articles
Browse latest Browse all 2707

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>