I'm having trouble importing files. Here is just the import portion that I'm trying to build (that I can't make work).
Sub Import_Files()
Dim ws As Worksheet
Dim ws1 As Worksheet
Dim path1 As String
Set ws = Worksheets("Main")
Set ws1 = Worksheets("Lists")
Set xl = CreateObject("Excel.Sheet")
path1 = ws1.Range("B2").Value ' will be my development directory until put in use
Application.ScreenUpdating = False
CurrentFileName = Dir(path1 & "\*.xls")
'H:\zz - working on it\CutSheet ' my development directory
Do
xl.Application.Workbooks.Open Dir(path1 & CurrentFileName)
Sheets().Move after:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
CurrentFileName = Dir()
Loop While CurrentFileName <> ""
End Sub
I have all the files in place in the "dev" folder, but keep getting an error that the filename is not found.
The file names that will be imported are:
W14X99992.xls
W14X99588.xls
W14X99AHA.xls
and so on...
There may be as few as 2 files or as many as 20 files to include in this new workbook. They are not static names or I could simple name all the options, so I need a wildcard entry.
Many thanks.
Bookmarks