如果在DELPHI中要引用EXCEL的公式或要把DELPHI中的公式到出到EXCEL,有什么方法?可以用FORMULAR 函数吗?急!!请各位大侠援手.
还有就是DELPHI如何查看一类文件是否存在,例如一次查看D:\AA目录下有没有EXCEL文件?

解决方案 »

  1.   

    if fileexists('c:\123.txt') then showmessage('ok')
      

  2.   

    問題一: 請用Excel的錄制宏.錄制你想要的動作,再去看它為你寫好的VB代碼.回到Delphi里把
            那些VB 代碼翻成Pascal就ok了!問題二: 看以下源碼:
    Function isExists(adir : string;Ex:string):boolean;
    var
      sr: TSearchRec;
      FileAttrs: Integer;
    begin
      Result := False ;
      FileAttrs :=  faAnyFile;
      if aDir[Length(adir)]<>'\' then
        aDir := aDir + '\';
      if SysUtils.FindFirst(aDir+Ex, FileAttrs, sr) = 0 then
      begin
        Result := True ;
        SysUtils.FindClose(sr);
      end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
    if isExists('f:\','*.JPg') then
      caption := 'OK';
    end;