Board index » delphi » Excel: changing sheetorder

Excel: changing sheetorder


2004-05-10 03:24:25 PM
delphi46
Hi all,
I have a program that creates sheets in an Exceldocument.
After creating all necessary sheets, I would like to order them in a certain
way.
Does anyone have a clue how to achieve this ? Some piece of code would be
appreciated.
Regards
Glenn
 
 

Re:Excel: changing sheetorder

Hi,
create workbook with 3 sheets in order: 'SheetNr1','SheetNr2','SheetNr3'.
Below you can find sample moves which in result should invert sheets order.
LSheets.Item['SheetNr3'].Move(Before:=LSheets.Item[1]);
LSheets.Item['SheetNr2'].Move(After:=LSheets.Item['SheetNr3']);
you may use sheet name or its current position in workbook as Item
parameter.
hth,
Mariusz
Użytkownik "Glenn De Tollenaere" <XXXX@XXXXX.COM>napisa?w wiadomości
Quote
Hi all,

I have a program that creates sheets in an Exceldocument.
After creating all necessary sheets, I would like to order them in a certain
way.

Does anyone have a clue how to achieve this ? Some piece of code would be
appreciated.

Regards
Glenn