home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2003 July / PCpro_2003_07.ISO / vollvers / edhtml / EdHTMLv5.0.exe / Main / Excel.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-05-14  |  1.5 KB  |  55 lines

  1. {        ..::EdHTML::..      }
  2. {     System Plug-In v1.0    }
  3. { Autor: RaLib Group         }
  4.  
  5. //Przyklad: OLE i Excel
  6.  
  7. Var ExcelWindow, NewWorkBooks, WorkBook, Cell, Range, Border, WorkSheet,
  8.     Diagram, MyDiagram : Variant;
  9.     Line, Column, LineCount, ColumnCount : Integer;
  10. begin
  11. ExcelWindow := CreateOleObject('Excel.Application');
  12. ExcelWindow.Visible := 1;
  13. ExcelWindow.Caption := 'Test';
  14. NewWorkBooks := ExcelWindow.Workbooks;
  15. WorkBook := NewWorkBooks.Add;
  16. LineCount := 10;
  17. ColumnCount := 5;
  18.  
  19. For Line := 1 to LineCount do
  20. begin
  21.    Cell := ExcelWindow.Cells(Line + 1, 1);
  22.    Cell.Value := 'Tresc ' + Line;
  23. end;
  24.  
  25. for column := 1 to ColumnCount do
  26. begin
  27.    Cell := ExcelWindow.Cells(1, Column + 1);
  28.    Cell.Value := 'Ups ' + Column;
  29. end;
  30.  
  31. for Line := 1 to LineCount do
  32.    for Column := 1 to ColumnCount do
  33.    begin
  34.       Cell := ExcelWindow.Cells(Line + 1, Column + 1);
  35.       Cell.Value := Line + Column;
  36.    end;
  37.  
  38. Range := ExcelWindow.Range(ExcelWindow.Cells(1, 1),
  39.                           ExcelWindow.Cells(LineCount + 1, ColumnCount + 1));
  40.  
  41. Range.Name := '╬ßδα±╞ⁿ─αφφ√⌡';
  42.  
  43. Border := Range.Borders;
  44.  
  45. Border.LineStyle := 1;
  46. Border.ColorIndex := 3;
  47.  
  48. WorkSheet := WorkBook.Worksheets(1);
  49. Diagram := WorkSheet.ChartObjects;
  50. Diagram := Diagram.Add(5, 5 + Range.Top + Range.Height,
  51.                           Range.Width, Range.Height);
  52. MyDiagram := Diagram.Chart;
  53. MyDiagram.ChartWizard('Jupijajej ', -4102, 6, 1, 1, 1, 1, 'Ollleee');
  54. end;
  55.