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 –