一次又一次地循环遍历同一文件。 VBA

时间:2019-07-12 14:47:13

标签: excel vba

我想遍历文件以在每个文件中执行一些操作。 但是,我的代码似乎总是一遍又一遍地打开相同的文件。 我做错了什么?

protocol SpecialView: View {
}

struct SpecialViewA : View, SpecialView {
    var body: some View {
        Text("Hello World!")
    }
}

struct ContentView<V>: View where V: SpecialView {
    var currentlyDisplayedView: V

    var body: some View{
        currentlyDisplayedView
    }

}

#if DEBUG
struct ContentView_Previews : PreviewProvider {
    static var previews: some View {
        ContentView(currentlyDisplayedView: SpecialViewA())
    }
}
#endif

Sub Loopndcopypaste() Dim K As Integer Dim ADDRESS As String Dim StrFile As String ADDRESS = "M:\Pierre\Announcement" K = 1 StrFile = Dir(ADDRESS & "\*") Do While Len(StrFile) > 0 Workbooks.Open Filename:=ADDRESS & "\" & StrFile Call AnalysisPDB Application.DisplayAlerts = False ActiveWorkbook.Close SaveChanges:=False Application.DisplayAlerts = True Debug.Print StrFile K = K + 1 If K = 5 Then Exit Sub Loop End Sub 不断返回相同的文件名

0 个答案:

没有答案
相关问题