My code is erroring on the "Wkb.Close False" line with an "Object Required" error, and I can't figure out why. This is my attempt to condense a lot of previous code, so I'm sure I've done soemthing wrong, but it's not jumping out at me. I'd sure appreciate some wisdom on this one.
ExpenseFolder = "\\12AUST1001FS01\SHARE10011\Budget\SOBUDGET\12MFR\Expense_Dtl_Reports\"
FileNames = Array("BR1112_ExpDtl_JAS.xls", "BR1112_ExpDtl_KP.xls", "BR1112_ExpDtl_DG.xls", _
"BR1112_ExpDtl_BV.xls", "BR1112_ExpDtl_JL.xls", "BR1112_ExpDtl_KG.xls", "BR1112_ExpDtl_Orphan.xls")
For Each Wkb In FileNames
If Dir(ExpenseFolder & Wkb) <> "" Then
Workbooks.Open ExpenseFolder & Wkb, ReadOnly:=True, UpdateLinks:=True
End If
FilterData
lrow = Cells(Rows.Count, 1).End(xlUp).Row
If lrow > 1 Then
'copy the detail to Today's sheet
ActiveSheet.UsedRange.Offset(1, 0).Resize(ActiveSheet.UsedRange.Rows.Count - 1).EntireRow.Copy Destination:=Exp.Sheets("Today").Range("A65536").End(xlUp).Offset(1, 0)
Else
End If
Application.CutCopyMode = False
Wkb.Close False
Next Wkb
---------- Post added at 11:48 AM ---------- Previous post was at 11:03 AM ----------
Well, I figured it out. Instead of
I put
ActiveWorkbook.Close False
. That did the trick!
Bookmarks