2015-07-12

【Delphi】偵測電腦是否有安裝 Excel

  1.  
  2. uses
  3. ActiveX, comObj, ...;
  4.  
  5.  
  6. procedure TForm1.Button1Click(Sender: TObject);
  7. var
  8. ClassID: TCLSID;
  9. begin
  10. // 檢查電腦是否有安裝 Excel
  11. if not Succeeded(CLSIDFromProgID(PWideChar(WideString('Excel.Application')),ClassID)) then
  12. begin
  13. ShowMessage('請檢查電腦是否有安裝 Excel');
  14. end;
  15. end;
  16.  

沒有留言:

張貼留言