I am using ADOMD 6.1 in an Excel 2010 Environment to send custom MDX Queries to an Analysis Services 2008 R2 Cube and to display the results in the excel workbook. This works fine so far, however the Excel instance is freezing while it waits for the Analysis Services Server to return the query result, and some of the queries may probably run for several minutes.
I would probably use threading to outsource the Connection into another thread, but according to some other questions asked around here, this is not possible in VBA itself - and we do have the constraint to not use DLLs, as we would need to distribute the resulting Excel with its macros to some end users and installing DLLs ist not an option. Using built-in Excel-Pivot-tables is not an option either as we rely on MDX-functions like intersect and exists.
Is there a non-blocking way to send querys to an Analysis Services Server using ADOMD in VBA without using external DLLs?
Dim ObjConnection As New ADODB.Connection
Dim rs As New ADODB.Recordset
ObjConnection.Open strCon
rs.Open strMDX, ObjConnection
Do While Not rs.EOF
For i = 0 To rs.Fields.Count - 1
Cells(i, 1).Value = rs.Fields(i).Name
Cells(i, 2).Value = rs.Fields(i).Value
Next
rs.MoveNext
Loop
Thanks a lot!