Вниз
Скачать: CL | DM;

excel   Найти похожие ветки 

 
bambina ©   (2003-01-23 11:43) [0]

chto-to vidimo ne zakrivaet xls...
procedure TF_Hauptmenu.FormCreate(Sender: TObject);
var i,R: Integer;
E,Worksheet: Variant;
s,t1,t2,t3,t4,t5,t6,u,v: String;
begin
E:= CreateOleObject("Excel.Application");
E.WorkBooks.open("D:\Irina\psc\excel\KTR_TAB.xls",true);
WorkSheet:= E.ActiveSheet;
R:=WorkSheet.UsedRange.Rows.Count;

s := "INSERT INTO KTR(Bezeichnung, K


 
Игорь Шевченко ©   (2003-01-23 12:23) [1]

unit main;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

type
TForm1 = class(TForm)
ListBox1: TListBox;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
uses
ComObj;

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
I, J, Rows, Cols: Integer;
E, Rng: Variant;
S: String;
begin
E := CreateOleObject("Excel.Application");
E.WorkBooks.open("D:\test.xls",true);
J := E.WorkBooks[1].WorkSheets[1].Rows.Count;
Rng := E.WorkBooks[1].WorkSheets[1].UsedRange;
Rows := Rng.Rows.Count;
Cols := Rng.Columns.Count;
ShowMessageFmt("Used rows=%d, used columns=%d", [Rows, Cols]);
for i := 2 to J do begin
S := E.WorkBooks[1].WorkSheets[1].Cells[i,1];
if S = "" then
Break;
ListBox1.Items.Add(S);
end;
E.Quit;
E := NULL;
end;

end.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
14-5167
gsu
2003-01-17 20:53
2003.02.03
Кто-нить с BPWin работал ?


4-5338
sel
2002-12-20 13:10
2003.02.03
Подключение к компу


1-4931
NewGuest
2003-01-26 10:57
2003.02.03
Мастера и любители прошу обратить внимание на данный код...


3-4813
Жека
2003-01-17 09:02
2003.02.03
QReport


1-4860
euru
2003-01-22 20:15
2003.02.03
Использование object




   Наверх