Dear All,
Today i face a new problem on my regular file which i use to compliing some files.
while debugging the same i found Double Workbook object are created in project explorer.
this is the code i am using
attached is the screen shot of the same, hope it is clear, these are my doubts
1. How 2 Workbooks could be there (Attached screen shot)
2. Line where i am getting error (Attached screen shot & Code Above)
Today i face a new problem on my regular file which i use to compliing some files.
while debugging the same i found Double Workbook object are created in project explorer.
this is the code i am using
Code:
Sub Compiler()
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("C:\Bhawna") 'from this folder files get complied.
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set bookList = Workbooks.Open(everyObj)
bookList.Worksheets(1).Range("A2:CN" & Range("A65536").End(xlUp).Row).Copy
ThisWorkbook.Worksheets(1).Activate 'Getting error here
Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
bookList.Close
Next
End Sub
attached is the screen shot of the same, hope it is clear, these are my doubts
1. How 2 Workbooks could be there (Attached screen shot)
2. Line where i am getting error (Attached screen shot & Code Above)