'有两种方法:
'第一种:
Dim FileName As StringFileName = Dir(App.Path & "\File\*.dbf")
Do While FileName <> ""
    If FileName <> "gather.dbf" Then
       'XXXX  导入操作
    End If
    
    FileName = Dir
Loop'第二种:
Dim FileName As StringFileName = Dir(App.Path & "\File\*.dbf")
Do While FileName <> ""
    If FileName = "gather.dbf" Then GoTo Ex_Do
      
   'XXXX  导入操作
   
    FileName = Dir
Ex_Do:
Loop

解决方案 »

  1.   

    和刚才一样啊,用gotoDim FileName As StringFileName = Dir(App.Path & "\File\*.dbf")
    Do While FileName <> ""
        If FileName = "gather.dbf" Then
            goto EX   '怎么处理
        End If
        
        'XXXX  导入操作
    EX:    
        FileName = DirLoop
      

  2.   

    都死循环了.
    do while和for的这种操作好像不同,上面方法只适应于for循环中.解决:
    Do While sNextFile <> "" And FileName<> "gather.dbf"