I need to copy data from closed workbooks, without opening them, into a master workbook using VBA.
I use Workbooks.Open
on from 4-6 files. Each file that needs to open dramatically slows the copy operation.
I need efficient VBA code for copying data without opening each file.
Here is an example of my code:
Set x = Workbooks.Open("C:\Bel.xls")
'Now, copy what you want from x:
x.Sheets("Daily Figures").Range("A13:j102").Copy
'Now, paste to y worksheet
y.Activate
Sheets("Data - Daily").Range("N2").PasteSpecial
'Close x:
Application.CutCopyMode = False
x.Close
Sheets("sheet1").Range("M4") = Date
Try this. It works using ADO without opening a source file: