Excel VBA Run Time Error '424' object required

1333117

New Member
Joined
Apr 18, 2013
Messages
20
Im new to VBA, Im trying to write a code which helps me in consolidating the excel data from multiple files in to one single excel file.
I am getting this error when trying to run the macro.

<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">Run Time Error '424' object requiredPlease find the below Macro CodeSub simpleXlsMerger()
Dim Booklist As Workbook
Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object
Application.ScreenUpdating = False
Set mergeObj = CreateObject("Scripting.FileSystemObject")


Set dirObj = mergeObj.Getfolder("M:\BIllable reports\Consolidation")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set boolist = Workbook.Open(everyObj)
Range("A1:IV" & Range("A65536").End(x1up).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A655536").End(x1up).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
Booklist.Close


Next


End Sub


</code></pre>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
It would help to state the line causing the error but you have several typos

Rich (BB code):
Dim Booklist As Workbook
Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object
Application.ScreenUpdating = False
Set mergeObj = CreateObject("Scripting.FileSystemObject")


Set dirObj = mergeObj.Getfolder("M:\BIllable reports\Consolidation")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set Booklist = Workbooks.Open(everyObj)
Range("A1:IV" & Range("A65536").End(xLup).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A655536").End(xLUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
Booklist.Close


Next
 
Upvote 0

Forum statistics

Threads
1,215,584
Messages
6,125,666
Members
449,248
Latest member
wayneho98

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top