I'll add some snippets of code that helps when Excel slows down.
This one here, deletes Excel's
Active Workbook Connections somewhere in the process of a continual web query.
My first count was over 200 connections at the same time. Excel became really sluggish.
I think it meant 200 web queries.
Imagine clicking your mouse 400 or 600 times at the Ribbon to delete these "connections" manually.
These "connections" were weeks old, well after the races had run.
I run this code before after each web query within a Do Until Loop.
So basically, you may consider running the code between the last race and the new race so the memory starts with a clean slate.
Quote:
Sub Delete_WorkBook_Connections()
' this deletes the connection if above zero count
Do While ActiveWorkbook.Connections.Count > 0
ActiveWorkbook.Connections.Item(ActiveWorkbook.Con nections.Count).Delete
'counter
Sheets("Sheet10").Range("C21").Value = Sheets("Sheet10").Range("B21").Value
Sheets("Sheet10").Range("B21").Value = Sheets("Sheet10").Range("B21").Value + 1
Loop
End Sub
|
-----------
To explain this part of the code is basically a counter showing the total times it Loops, ( meaningless/important statistical stuff).
Quote:
'counter
Sheets("Sheet10").Range("C21").Value = Sheets("Sheet10").Range("B21").Value
Sheets("Sheet10").Range("B21").Value = Sheets("Sheet10").Range("B21").Value + 1
|
Mine is curently up to 5208.
This means the Excel race worksheet has connected 5208 times in that particular Workbook.
Running the code eliminated the task of clicking the mouse 5208 multiplied by about 3
5208 * 3 would have been lots of mouse clicks, lots of races missed, POT down.
Or do it manually on Excel 2010, click on Data then click on Connections, there you will see it under Workbook Connections.
Run the above code and it goes away, freeing up Excel.