Create/Add "Placed" Worksheets, Move Worksheets

Topics: Developer Forum, User Forum
Oct 5, 2009 at 4:05 PM

Is there the ability to add worksheets at a certain place/order.

For example, I have a excel file with 10 worksheets, and after I have created these, I want to add a worksheet at the "0" index.

Also, is there a way to move worksheets around?

Or

Do you have to create the worksheets in the final order you want them?

 

Thanks,

Bryan

Developer
Oct 6, 2009 at 1:42 AM

>> Is there the ability to add worksheets at a certain place/order.

No, you can only create sheets at the end.

>> Also, is there a way to move worksheets around?

Thanks to user submitted patch, you can do like this starting with PHPExcel 1.7.0:

$objPHPExcel->setIndexByName('MySheet', 0); // move 'MySheet' to index zero (first sheet)