Does xlCalculationState change when running PQ?

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
516
Office Version
  1. 365
Platform
  1. Windows
Hi All,
My model is laden with many Application.Wait Now + Timevalue statements so that VBA can finish processing before moving to dependant calculations.
The main issue is that the TimeValue on Monday can be 30 seconds and on Saturday can be 2 minutes.
What I would like to do is change those Application.Wait Now + Timevalue statements to something a bit more precise.
So I am looking at the xlCalculationState property.
With VBA & Excel, I understand that this property works great. However, I also have a considerable number of PQ processes sprinkled through the VBA code.
Does the xlCalculationState property also work when a PQ is still running?

I am looking at something like this to pause VBA Macro execution:

Do
DoEvents
Application.Calculate
Loop While Not Application.CalculationState = xlDone


Thanks in advance
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,215,090
Messages
6,123,061
Members
449,091
Latest member
ikke

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