Re: Linked Workbooks, Extreme Lag/Processing Time
I've noticed something interesting for this formula. As it stands, there is no error, but when I change the range to what I need (Copy C2 range, paste in B2), it produces the error. With the range of A, it won't paste, but won't produce the error.
Quote from dbrown14;571070This should be better
CodeDisplay MoreOption Explicit Sub ozgrid() Dim ex As Excel.Application Dim wrkbk As Workbook Dim sht1, sht2, sht3 As Worksheet Dim filepath, wname As String On Error GoTo errH: Application.ScreenUpdating = False filepath = "C:\Users\dbrown\Desktop\ex2.xlsx" Set ex = Excel.Application Set wrkbk = ex.Workbooks.Open(filepath) Set sht1 = wrkbk.Sheets(1) Set sht2 = wrkbk.Sheets(2) Set sht3 = ThisWorkbook.Sheets(2) ThisWorkbook.Sheets(1).Range("B2", _ ThisWorkbook.Sheets(1).Range("B2").End(xlDown).End(xlToRight)).Copy If IsEmpty(sht1.Range("A1")) Then sht1.Range("A1").PasteSpecial xlValues ElseIf IsEmpty(sht1.Range("A2")) Then sht1.Range("A2").PasteSpecial xlValues Else sht1.Range("A1").End(xlDown).Offset(1, 0).PasteSpecial xlValues End If If IsEmpty(sht2.Range("A1")) Then sht2.Range("A1").PasteSpecial xlValues ElseIf IsEmpty(sht2.Range("A2")) Then sht2.Range("A2").PasteSpecial xlValues Else sht2.Range("A1").End(xlDown).Offset(1, 0).PasteSpecial xlValues End If If IsEmpty(sht3.Range("A1")) Then sht3.Range("A1").PasteSpecial xlValues ElseIf IsEmpty(sht3.Range("A2")) Then sht3.Range("A2").PasteSpecial xlValues Else sht3.Range("A1").End(xlDown).Offset(1, 0).PasteSpecial xlValues End If wrkbk.Close True Set ex = Nothing Application.ScreenUpdating = True Exit Sub errH: MsgBox Err.Description End Sub