Thầy ơi! Em copy dữ liệu từ SAP GUI ra file excel theo code sau nhưng nó lại bị lỗi. Đối với dữ liệu ít thì copy được toàn bộ. Nhưng đối với dữ liệu lớn thì chỉ copy được 1 nửa
Application.ScreenUpdating = False
With Sheet1
Worksheets.Add
ActiveSheet.Name = Sheet1.Range("G" & i).Value
ActiveSheet.Select
Set TBL = session.findById("wnd[0]/shellcont/shell/shellcont[0]/shell")
For x = 1 To TBL.RowCount
For y = 1 To TBL.columncount
ActiveSheet.Cells(x, y).Value = TBL.GetCellValue(x - 1, TBL.ColumnOrder(y - 1))
Next y
Next x
.Select
End With
Application.ScreenUpdating = True