这样,如果1.xls正在使用
var
hfile:Thandle;
timp:Thandle;
begin
hFile := CreateFile(pchar('c:/1.xls'), // file to open
GENERIC_READ, // open for reading
FILE_SHARE_READ, // share for reading
nil, // default security
OPEN_EXISTING, // existing file only
FILE_ATTRIBUTE_NORMAL, // normal file
timp); // no attr. template
showmessage(inttostr(hfile)+' '+inttostr(timp));
//成功取得文件句柄。就show出来
//楼主试用一下。
//t:=Tfilestream.Create('c:/1.xls',fmOpenRead);//这种方式就要抱错。