File searching in VBA

后端 未结 3 980
青春惊慌失措
青春惊慌失措 2020-12-21 01:29

I wrote a vba code that browse all path folder and search for \"strings.xml\" file.

Dim oFS As Office.FileSearch
Dim i As Integer
Set oFS = Application.FileS         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 02:15

    replace:

    sPath = "D:\Workspace\values" 'Change Path
    sFil = Dir(sPath & "string.xml") 'All files in Directory matching name
    

    with:

    sPath = "D:\Workspace\values\" 'Change Path
    sFil = Dir(sPath & "*.xl*") 'All files in Directory matching name
    

提交回复
热议问题