I have a cube connected to Pivots in excel.
In one cell i display the "latest updated" value by this formula:

```
=CUBEVALUE("CUBE NAME";"[Measures].[Last Data Update]")

```

It takes 5-10 seconds for excel to get the time of update from the cube and update the cell. So, if i close the workbook directly after it will just say n/a when I reopen the workbook.

I have scheduled this wb to autoupdate (among other wbs) through another wb that is scheduled to run every day. 
With that I get the n/a problem.
I see two solutions which I don´t know how to get to:

1, Halt the macro for 10 seconds so it can get the date correctly.
- I have tried both Wait and Sleep Vba but this also pauses calculations.
- is there any way to only pause the macro from executing?

2, Get the update date by vba and then print it to a cell.
- I have no idea how to do this. I have searched but not found any alternative.
- Does anyone know how this could be made possible?

Thanks
Elias

SOLVED:

Just want to share my solution. Found the CalculateUntilAsyncQueriesDone Method which handles OLAP data sources:

```
                    Application.CalculateUntilAsyncQueriesDone

                    Do While Application.CalculationState <> xlDone
                        DoEvents
                    Loop

```

More info here: <https://msdn.microsoft.com/en-us/library/office/ff821008.aspx>