lamer666 Цитата: Дома попробую. Спасибо!
Завсегда пожалуйста
. Если что-то заработает - поделись опытом
.
VictorNik Цитата: Ну прямо Цицерон. Уговорил.
Это я? Да я никогда никого не уговаривал, это тебе показалось
.
Цитата: И ежели не влом - ткни носом в пример.
Вот, кусок собственноручно написанной поделки. Выкидывает в Excel содежимое SGList, рисует шапку и проч., использует позднее связывание.
Код: procedure TFrmMain.BtnSaveClick(Sender: TObject);
var i: integer;
FName: String;
XL: Variant;
begin
FName := ExtractFilePath(Application.Exename) + 'Stat.xls';
XL := CreateOleObject('Excel.Application.8');
XL.Visible := True;
XL.Workbooks.Add(-4167);
XL.Workbooks[1].ActiveSheet.Cells.Font.Size := 8;
XL.Workbooks[1].ActiveSheet.PageSetup.Orientation := 2;
XL.Workbooks[1].ActiveSheet.PageSetup.LeftMargin := XL.Workbooks[1].Application.CentimetersToPoints(1);
XL.Workbooks[1].ActiveSheet.PageSetup.RightMargin := XL.Workbooks[1].Application.CentimetersToPoints(0.5);
XL.Workbooks[1].ActiveSheet.PageSetup.TopMargin := XL.Workbooks[1].Application.CentimetersToPoints(1);
XL.Workbooks[1].ActiveSheet.PageSetup.BottomMargin := XL.Workbooks[1].Application.CentimetersToPoints(1);
XL.Workbooks[1].ActiveSheet.Columns[1].ColumnWidth := 3;
XL.Workbooks[1].ActiveSheet.Columns[2].ColumnWidth := 4.3;
XL.Workbooks[1].ActiveSheet.Columns[3].ColumnWidth := 14;
XL.Workbooks[1].ActiveSheet.Columns[4].ColumnWidth := 20;
XL.Workbooks[1].ActiveSheet.Columns[5].ColumnWidth := 3;
XL.Workbooks[1].ActiveSheet.Columns[6].ColumnWidth := 5;
XL.Workbooks[1].ActiveSheet.Columns[7].ColumnWidth := 5;
XL.Workbooks[1].ActiveSheet.Columns[8].ColumnWidth := 5;
XL.Workbooks[1].ActiveSheet.Columns[9].ColumnWidth := 5;
XL.Workbooks[1].ActiveSheet.Columns[10].ColumnWidth := 5;
XL.Workbooks[1].ActiveSheet.Columns[11].ColumnWidth := 5;
XL.Workbooks[1].ActiveSheet.Columns[12].ColumnWidth := 6;
XL.Workbooks[1].ActiveSheet.Columns[13].ColumnWidth := 20;
XL.Workbooks[1].ActiveSheet.Columns[14].ColumnWidth := 8;
XL.Workbooks[1].ActiveSheet.Columns[15].ColumnWidth := 20;
XL.Workbooks[1].ActiveSheet.Rows[3].RowHeight := 3;
XL.Workbooks[1].ActiveSheet.Rows[5].RowHeight := 4;
XL.Workbooks[1].ActiveSheet.Rows[7].RowHeight := 3;
XL.Workbooks[1].ActiveSheet.Cells[1,13].Value := 'Президент ЗАО "Paranoid UnLimited"';
XL.Workbooks[1].ActiveSheet.Cells[2,14].Value := 'Dim2004';
XL.Workbooks[1].ActiveSheet.Cells[4,13].Value := '" " _________ 200_ года';
XL.Workbooks[1].ActiveSheet.Cells[6,1].Value := 'Таблица по расчету заработной платы';
XL.Workbooks[1].ActiveSheet.Range['A6:O6'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['A6:O6'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['A6:O6'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['A6:O6'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['A6:O6'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['A6:O6'].Font.Bold := TRUE;
XL.Workbooks[1].ActiveSheet.Range['A6:O6'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[8,1].Value := '№';
XL.Workbooks[1].ActiveSheet.Range['A8:A11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['A8:A11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['A8:A11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['A8:A11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['A8:A11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['A8:A11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['A8:A11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[8,2].Value := 'Должность';
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].Borders[7].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].Borders[7].Weight := 2;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['B8:B11'].Borders[10].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[8,3].Value := 'ФИО';
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['C8:C11'].Borders[10].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[8,4].Value := StatPeriod;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].Borders[9].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['D8:K8'].Borders[9].Weight := -4138;
XL.Workbooks[1].ActiveSheet.Cells[9,4].Value := 'Часы';
XL.Workbooks[1].ActiveSheet.Range['D9:D11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['D9:D11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['D9:D11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['D9:D11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['D9:D11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['D9:D11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['D9:D11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[9,5].Value := 'Тар. ставка';
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].Borders[7].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].Borders[7].Weight := 2;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['E9:E11'].Borders[10].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[9,6].Value := 'День';
XL.Workbooks[1].ActiveSheet.Cells[9,6].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[10,6].Value := '08:00-20:00';
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].Borders[9].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['F10:G10'].Borders[9].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[11,6].Value := 'Сообщ.';
XL.Workbooks[1].ActiveSheet.Cells[11,6].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['F11:F11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['F11:F11'].Borders[10].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[11,7].Value := '$$';
XL.Workbooks[1].ActiveSheet.Cells[11,7].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[9,8].Value := 'Вечер';
XL.Workbooks[1].ActiveSheet.Cells[9,8].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[10,8].Value := '20:00-24:00';
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].Borders[9].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['H10:I10'].Borders[9].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[11,8].Value := 'Сообщ.';
XL.Workbooks[1].ActiveSheet.Cells[11,8].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['H11:H11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['H11:H11'].Borders[10].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[11,9].Value := '$$';
XL.Workbooks[1].ActiveSheet.Cells[11,9].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[9,10].Value := 'Ночь';
XL.Workbooks[1].ActiveSheet.Cells[9,10].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[10,10].Value := '00:00-08:00';
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].Borders[9].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['J10:K10'].Borders[9].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[11,10].Value := 'Сообщ.';
XL.Workbooks[1].ActiveSheet.Cells[11,10].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['J11:J11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['J11:J11'].Borders[10].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[11,11].Value := '$$';
XL.Workbooks[1].ActiveSheet.Cells[11,11].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['H9:I11'].Borders[7].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['H9:I11'].Borders[7].Weight := 2;
XL.Workbooks[1].ActiveSheet.Range['H9:I11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['H9:I11'].Borders[10].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[8,12].Value := 'Всего $$';
XL.Workbooks[1].ActiveSheet.Range['L8:L11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['L8:L11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['L8:L11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['L8:L11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['L8:L11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['L8:L11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['L8:L11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[8,13].Value := 'Доплата $$';
XL.Workbooks[1].ActiveSheet.Range['M8:M11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['M8:M11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['M8:M11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['M8:M11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['M8:M11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['M8:M11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['M8:M11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[8,13].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[8,14].Value := 'Итого $$';
XL.Workbooks[1].ActiveSheet.Range['N8:N11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['N8:N11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['N8:N11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['N8:N11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['N8:N11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['N8:N11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['N8:N11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Cells[8,15].Value := 'Примечание';
XL.Workbooks[1].ActiveSheet.Range['O8:O11'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['O8:O11'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['O8:O11'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['O8:O11'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['O8:O11'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['O8:O11'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['O8:O11'].VerticalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[7].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[7].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[8].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[8].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[10].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[9].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A8:O11'].Borders[9].Weight := 2;
XL.Workbooks[1].ActiveSheet.Range['L8:O11'].Borders[7].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['L8:O11'].Borders[7].Weight := 2;
XL.Workbooks[1].ActiveSheet.Range['L8:O11'].Borders[11].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['L8:O11'].Borders[11].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[12,1].Value := 'Зал';
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].WrapText := True;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Orientation := 0;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].IndentLevel := 0;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].ShrinkToFit := False;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].MergeCells := True;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].HorizontalAlignment := -4108;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[7].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[7].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[8].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[8].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[10].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[9].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range['A12:O12'].Borders[9].Weight := 2;
XL.Workbooks[1].ActiveSheet.Cells[9,7].Value := FormatFloat('0.000', Day);
XL.Workbooks[1].ActiveSheet.Cells[9,9].Value := FormatFloat('0.000', Evening);
XL.Workbooks[1].ActiveSheet.Cells[9,11].Value := FormatFloat('0.000', Night);
for i:=1 to SGList.RowCount-1 do begin
XL.Workbooks[1].ActiveSheet.Cells[i+12,1].Value := SGList.Cells[0, i];
XL.Workbooks[1].ActiveSheet.Cells[i+12,3].Value := SGList.Cells[1, i];
XL.Workbooks[1].ActiveSheet.Cells[i+12,6].Value := SGList.Cells[2, i];
XL.Workbooks[1].ActiveSheet.Cells[i+12,7].Formula := '=RC[-1]*R9C7';
XL.Workbooks[1].ActiveSheet.Cells[i+12,8].Value := SGList.Cells[4, i];
XL.Workbooks[1].ActiveSheet.Cells[i+12,9].Formula := '=RC[-1]*R9C9';
XL.Workbooks[1].ActiveSheet.Cells[i+12,10].Value := SGList.Cells[6, i];
XL.Workbooks[1].ActiveSheet.Cells[i+12,11].Formula := '=RC[-1]*R9C11';
XL.Workbooks[1].ActiveSheet.Cells[i+12,12].Formula := '=RC[-5]+RC[-3]+RC[-1]';
end;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[7].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[7].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[8].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[8].Weight := 2;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[10].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[10].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[9].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[9].Weight := 4;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[11].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[11].Weight := 2;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[12].LineStyle := 1;
XL.Workbooks[1].ActiveSheet.Range[XL.Workbooks[1].ActiveSheet.Cells[13, 1], XL.Workbooks[1].ActiveSheet.Cells[SGList.RowCount+11, 15]].Borders[12].Weight := 2;
XL.Workbooks[1].ActiveSheet.Name := 'Статистика';
XL.Workbooks[1].SaveAs(FName);
XL.DisplayAlerts := False;
XL.Quit;
MessageDlg('Статистика была сохранена в файл ' + FName, mtInformation, [mbOk], 0)
end;