Code:
Sub abc()
Dim AsiaELNpath As String
Dim AELN As Workbook
AsiaELNpath = "X:\Asia ex HK ELN Indications\Daily ELN Indications (Base) Asia ex HK.xls"
Set AELN = Workbooks.Open(AsiaELNpath)
ThisWorkbook.Worksheets("Asia Stocks").Range("A1:Z100").Copy
AELN.Worksheets("Database").Range("A1:Z100").Pastespecial
End Sub
I used F8 to run codes row by row. When it comes to the last row it crashed with a bug.
It said that it had a run-time error '40036':
Application-defined or object-defined error
I double checked the name of the worksheet of both workbooks. I can't figure out what the problem is...spent me 2hrs...help