0
我的代码是:Excel VBA中打开的工作簿
Dim wb As Workbook
Dim MyObj As Object, MySource As Object, file As Variant
file = Dir("C:\Users\dlf164\Desktop\NE\")
While (file <> "")
If InStr(file, a) > 0 Then
Set wb = Workbooks.Open(file)
End If
file = Dir
Wend
其中我收到的错误是应用或对象定义运行时错误。
如何解决这个问题?
也许'文件'不是Excel(兼容)文件? –
它的excel兼容 – user3764484
http://stackoverflow.com/questions/10380312/loop-through-files-in-a-folder-using-vba –