如何操作Excel????
ExcelApp := CreateOleObject('Excel.Application'); ExcelApp .WorkBooks.Open(Path);//Path:excel的路径 ExcelApp .visible := False;
function My_CreateOleObject(const ClassName: string; out Ole_Handle: IDispatch): Boolean;var ClassID: TCLSID; l_Result: HResult;begin Result := False; l_Result := CLSIDFromProgID(PWideChar(WideString(ClassName)), ClassID); if (l_Result and $80000000) = 0 then begin l_Result := CoCreateInstance(ClassID, nil, CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IDispatch, Ole_Handle); if (l_Result and $80000000) = 0 then Result := True; end;end;