H
helpmehelpme
Unregistered / Unconfirmed
GUEST, unregistred user!
var ExcelApp,Workbook,WorkSheet:Variant;
begin
try
ExcelApp := CreateOleObject('Excel.Application');
except
DispErr('Could not Create Excel Application!');
abort;
end;
try
ExcelApp := CreateOleObject('Excel.Application');
except
DispErr('PPMS010-02 Could not Create Excel Application!');
abort;
end;
try
try
ExcelApp.WorkBooks.Open(edtDir.text,,True);
except
ExcelApp.Quit;
end;
WorkBook:=ExcelApp.ActiveWorkbook;
WorkSheet:=WorkBook.ActiveSheet;
// get Excel row counts
rows:=0;
i:=0;
sTemp:=string(WorkSheet.Cells[i,1]);
while not (VarIsNull(sTemp)) and (sTemp='') do
begin
rows:=rows+1;
i:=i+1;
sTemp:=string(WorkSheet.Cells[i,1]);
end;
finally
ExcelApp.Free;
end;
end;
end;
那位大侠帮我看看,为什么
ExcelApp := CreateOleObject('Excel.Application');
出错,错误提示:
...raise exception class EOleSysError with message '拒绝访问'!
我的机器上装有office200;为什么不能呢?
后来我想改用Servers控件页的TExcelApplication,TExcelWorkbook,TExcelworkSheet;
可是却没有连机帮助!
有谁能告诉我这三个空间的用法吗?
begin
try
ExcelApp := CreateOleObject('Excel.Application');
except
DispErr('Could not Create Excel Application!');
abort;
end;
try
ExcelApp := CreateOleObject('Excel.Application');
except
DispErr('PPMS010-02 Could not Create Excel Application!');
abort;
end;
try
try
ExcelApp.WorkBooks.Open(edtDir.text,,True);
except
ExcelApp.Quit;
end;
WorkBook:=ExcelApp.ActiveWorkbook;
WorkSheet:=WorkBook.ActiveSheet;
// get Excel row counts
rows:=0;
i:=0;
sTemp:=string(WorkSheet.Cells[i,1]);
while not (VarIsNull(sTemp)) and (sTemp='') do
begin
rows:=rows+1;
i:=i+1;
sTemp:=string(WorkSheet.Cells[i,1]);
end;
finally
ExcelApp.Free;
end;
end;
end;
那位大侠帮我看看,为什么
ExcelApp := CreateOleObject('Excel.Application');
出错,错误提示:
...raise exception class EOleSysError with message '拒绝访问'!
我的机器上装有office200;为什么不能呢?
后来我想改用Servers控件页的TExcelApplication,TExcelWorkbook,TExcelworkSheet;
可是却没有连机帮助!
有谁能告诉我这三个空间的用法吗?