How do I let Excel breath?

Jaymond Flurrie

Well-known Member
Joined
Sep 22, 2008
Messages
921
Office Version
  1. 365
Platform
  1. Windows
I run a long, demanding VBA code task with Excel and I would like to let my user to see that something is happening. Excel does application.statusbar nicely for a while until it "chokes" and stops updating. What's the smartest way to let Excel "breath"?

I tried this:

Code:
If x Mod 250 = 0 Then
                Application.StatusBar = "Running the task, " & x & "/" & lTotal & " = " & Format(x / lTotal, "0.00%") & " done"
                If x Mod 5000 = 0 Then
                    Application.Wait (10)
                End If
            End If

but it still "chokes". Other ideas?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I have very large charts - scattered all over the sheet - so I have a counter - when it reaches 5K (cells process) then I display my statusbar (like % thing you have) - I have to read the data in arrays as the range value cannot exceed 255 characters - I then reset counter and let it start all over. The max number of points in most charts are 32K - so I start new charts if I have more that 32K points - it may take Excel several minutes - but it does not choke. But be carefull not to have arrays that are to large - or in my case try to stuff arrays into charts above the limits - the Excel does freeze - without even getting an error. Not sure if this helps
 
Upvote 0
I have very large charts - scattered all over the sheet - so I have a counter - when it reaches 5K (cells process) then I display my statusbar (like % thing you have) - I have to read the data in arrays as the range value cannot exceed 255 characters - I then reset counter and let it start all over. The max number of points in most charts are 32K - so I start new charts if I have more that 32K points - it may take Excel several minutes - but it does not choke. But be carefull not to have arrays that are to large - or in my case try to stuff arrays into charts above the limits - the Excel does freeze - without even getting an error. Not sure if this helps

Hmmm... I have to try that too. I found out that switching application.screenupdating off and on helps too.

I just coded a arraysplitter that uses 20x5000 rows instead of 1x100000 rows. Excel seemed to freeze every now and then with those 100000, but I haven't tested enough to say what it says about that 20x5000.
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top