Is there a way to improve performance of importing big chunks of .xls data to a main .xls?
My code to import data:
Applications at start (and reversing at the end):
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
SaveChanges = False
Import code:
Workbooks.OpenXML (filePath & "chunkOfData001.xls")
Set WBtemp = ActiveWorkbook
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
WBmain.Activate
Sheets("ImportedChunkOfData").Activate
Range("A1").Select
ActiveSheet.Paste
WBtemp.Close
I followed user GWD's tip and got a really great result.
Here is the code now. Can it be pushed further?
I kept Applications
Import code (relevant lines):
Dim WBmontagem As Workbook
Dim WBsap As Workbook
Dim v As Variant
Set WBmain = ActiveWorkbook
Set WBtemp = Workbooks.OpenXML(filePath & "chunkOfData.xls")
v = WBtemp.ActiveSheet.Range("A1:I150000").Value
WBmain.Sheets("ImportedChunkOfData").Range("A1").Value = v
WBtemp.Close