Private Function doXMLA(cnn, databaseID As String, Optional dimensionID As String = "", Optional timeout As Long = 30) Dim xmla As String Dim lRet Dim comm As Object ' ADODB.Command ' The XMLA Batch request If dimensionID = "" Then xmla = "<Batch xmlns=""http://schemas.microsoft.com/analysisservices/2003/engine""><Parallel><Process xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:ddl2=""http://schemas.microsoft.com/analysisservices/2003/engine/2"" xmlns:ddl2_2=""http://schemas.microsoft.com/analysisservices/2003/engine/2/2"" xmlns:ddl100_100=""http://schemas.microsoft.com/analysisservices/2008/engine/100/100""><Object><DatabaseID><<<DatabaseID>>></DatabaseID></Object><Type>ProcessFull</Type><WriteBackTableCreation>UseExisting</WriteBackTableCreation></Process></Parallel></Batch>" xmla = Replace(xmla, "<<<DatabaseID>>>", databaseID) Else xmla = "<Batch xmlns=""http://schemas.microsoft.com/analysisservices/2003/engine""><Parallel><Process xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:ddl2=""http://schemas.microsoft.com/analysisservices/2003/engine/2"" xmlns:ddl2_2=""http://schemas.microsoft.com/analysisservices/2003/engine/2/2"" xmlns:ddl100_100=""http://schemas.microsoft.com/analysisservices/2008/engine/100/100""><Object><DatabaseID><<<DatabaseID>>></DatabaseID><DimensionID><<<DimensionID>>></DimensionID></Object><Type>ProcessFull</Type><WriteBackTableCreation>UseExisting</WriteBackTableCreation></Process></Parallel></Batch>" xmla = Replace(xmla, "<<<DatabaseID>>>", databaseID) xmla = Replace(xmla, "<<<DimensionID>>>", dimensionID) End If Set comm = CreateObject("ADODB.command") comm.CommandTimeout = timeout comm.CommandText = xmla Set comm.ActiveConnection = cnn comm.Execute ' Make the request 'On Error Resume Next - comment out on error as most are not trappable within VBA !!! 'lRet = cnn.Execute(xmla) 'If Err Then Stop doXMLA = "OK" End Function
I have an Excel 2010 workbook with PowerPivot which is connected to an Access 2010 query. The workbook uses Goban Saor's VBA code to refresh the data. Recently I made a small change to the Access query. Now the refresh code stops at line "comm.Execute" (about 8 lines from the bottom) in the attached function with Run-Time error '2147467259 (80004005)' "The current operation was cancelled because another operation in the transaction failed" All I did was make a small change to the acccess query - nothing else. I can manually refresh the PowerPivot window and the pivot table without any problem. Any ideas of what may be causing this?