返回列表 上一主題 發帖

[發問] With Application.FileSearch 無法使用

[發問] With Application.FileSearch 無法使用

Dear 大大,
   之前用office 97時我都使用With Application.FileSearch找檔案
   今天用不同的office版本才發現office改版後己經不能再用了,
    請問各位前大大,以下程式碼應該怎麼修改才好?


  With Application.FileSearch
    .NewSearch
    .LookIn = FilePath
    .Filename = ".txt"
    .SearchSubFolders = False
    .Execute
   
    For i = 1 To .FoundFiles.Count
     Cells(RowIdx, 1) = FileDateTime(.FoundFiles(i))
     Cells(RowIdx, 1).Select
      FName = .FoundFiles(i)
      Cells(RowIdx, ColIdx).Select
      
      Open FName For Input As #1
       .
       .

感謝 wqfzqgk & GBKEE版大的指導,

   GBKEE 版大所提供的正是我想要的~~ 萬分感謝

TOP

        靜思自在 : 多做多得。少做多失。
返回列表 上一主題