Excel.WorkBooks[1].WorkSheets[y].PageSetup.RightHeader := 'Anexo';
...
Excel.WorkBooks[1].WorkSheets[y].PageSetup.RightMargin := 10 ;
Excel.WorkBooks[1].WorkSheets[y].PageSetup.LeftMargin := 16 ;
Excel.WorkBooks[1].WorkSheets[y].PageSetup.HeaderMargin := 18;
Excel.WorkBooks[1].WorkSheets[y].PageSetup.TopMargin := 136;
Excel.WorkBooks[1].WorkSheets[y].PageSetup.PrintTitleRows := '$3:$7';
Rango : OleVariant;
...
Rango := Excel.WorkBooks[1].WorkSheets[2].Range['A8:F8200'];
Rango.Sort(Excel.WorkBooks[1].WorkSheets[2].Range['E1'],EmptyParam,xlAscending,Excel.WorkBooks[1].WorkSheets[2].Range['B1'], xlAscending);