C
celkelly
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button2Click(Sender: TObject);
var
ExcelBook:variant;
SN,MODEL,VNAME:string;
PISTRING;
I,J:INTEGER;
begin
ExcelBook:=CreateOleobject('Excel.application');
SN :='I00001';
MODEL:='SQB';
if opendialog1.Execute then
ExcelBook.workbooks.open(opendialog1.FileName);
ExcelBook.visible:=true;
for i:=1 to 10 do
for j:=1 to 10 do
begin
vfield:=ExcelBook.worksheets[1].cells[i,j];
if copy(vfield,1,1)='&' then
begin
vname:=copy(vfield,2,length(vfield)-1);
PI:=@VNAME;
EDIT1.Text:=PI^;
END;
end;
我想EDIT1.TEXT结果是 I00001 OR SQB
而现在结果是 SN OR MODEL
我还怎么指一下??
var
ExcelBook:variant;
SN,MODEL,VNAME:string;
PISTRING;
I,J:INTEGER;
begin
ExcelBook:=CreateOleobject('Excel.application');
SN :='I00001';
MODEL:='SQB';
if opendialog1.Execute then
ExcelBook.workbooks.open(opendialog1.FileName);
ExcelBook.visible:=true;
for i:=1 to 10 do
for j:=1 to 10 do
begin
vfield:=ExcelBook.worksheets[1].cells[i,j];
if copy(vfield,1,1)='&' then
begin
vname:=copy(vfield,2,length(vfield)-1);
PI:=@VNAME;
EDIT1.Text:=PI^;
END;
end;
我想EDIT1.TEXT结果是 I00001 OR SQB
而现在结果是 SN OR MODEL
我还怎么指一下??