This full code pulls data from a work website into Excel. Can be up to 55000 rows. Currently on Excel 2019 it takes forever to run. Also uses between 33%-50% of cpu. On 2016 it worked fine. I use a code already that turns off all things like calculations, events, etc.
I am thinking an array would make it faster but not sure how to do that. When I press ESC during execution when it’s taking forever it’s always on one of the CallByName lines. Any help would be very appreciated. Thank you in advance!
I am thinking an array would make it faster but not sure how to do that. When I press ESC during execution when it’s taking forever it’s always on one of the CallByName lines. Any help would be very appreciated. Thank you in advance!
VBA Code:
For Each key In keyring
.Cells(Row, 1) = haul_id
.Cells(Row, 2) = CallByName(CallByName(Json, key, VbGet), "ID", VbGet)
.Cells(Row, 3) = CallByName(CallByName(Json, key, VbGet), "state", VbGet)
.Cells(Row, 4) = CallByName(CallByName(Json, key, VbGet), "size", VbGet)
.Cells(Row, 6) = CallByName(CallByName(Json, key, VbGet), "section", VbGet)
.Cells(Row, 7) = CallByName(CallByName(Json, key, VbGet), "date", VbGet)
.Cells(Row, 8) = CallByName(CallByName(Json, key, VbGet), "cycle", VbGet)
If CallByName(CallByName(Json, key, VbGet), "Area", VbGet) <> "" Then
.Cells(Row, 5) = Split(CallByName(CallByName(Json, key, VbGet), "Area", VbGet), ".")(0)
End If
Row = Row + 1
Next key
Next line_haul
End With
Call LudicrousMode(False)
End Sub