, , ( ?), Windows EnumWindows, , Excel . (, , Excel.)
, , "Excel" , Excel .
, . , , , . , , ...
Google "EnumWindows Delphi" .
... , - . , API Excel. , CreateOLEObject unAssigned . ( ... , Excel ..). Excel , IMO. , (, "", " " Excel?), .
, , , , Excel . ( , ... , , , .)
, :
uses ComObj;
function FindWorkbook( Workbookname: String):boolean;
var
ExcelOLE: Variant;
WorkbookNumber: Integer;
begin
Result := FALSE;
ExcelOLE := CreateOLEObject('Excel.Application');
try
for WorkbookNumber := 1 to ExcelOLE.Workbooks.Count do
if UpperCase(WorkbookName) = UpperCase(ExcelOLE.Workbooks[WorkbookNumber].Name) then
Result := TRUE;
finally
ExcelOLE := unAssigned;
end;
end;