Hello, beautiful minds!
I have an Excel file that connects to a Cube on a SQL database. I created that connection with Get Data > From Database > From Analysis Services.
The cube I ma connecting to is updated every few hours and while that process is happening, I cannot work on my file.
Is there a way to verify with VBA if the cube is available before proceeding to data refreshing or other procedures within the file? I am pasting the code that I recorded when adding the connection:
Thank you, in advance, for any guidance you might provide.
Enjoy your day!
Thank you.
I have an Excel file that connects to a Cube on a SQL database. I created that connection with Get Data > From Database > From Analysis Services.
The cube I ma connecting to is updated every few hours and while that process is happening, I cannot work on my file.
Is there a way to verify with VBA if the cube is available before proceeding to data refreshing or other procedures within the file? I am pasting the code that I recorded when adding the connection:
Code:
Application.CutCopyMode = False With ActiveWorkbook.Connections("cs-sql03 BI ERP test").OLEDBConnection
.CommandText = Array("ERP")
.CommandType = xlCmdCube
.Connection = Array( _
"OLEDB;Provider=MSOLAP.8;Integrated Security=SSPI;Persist Security Info=True;Data Source=cs-sql03;Update Isolation Level=2;Initial Cata" _
, "log=BI")
.RefreshOnFileOpen = False
.SavePassword = False
.SourceConnectionFile = _
"\\cs-dc1\data\users\calves\My Data Sources\cs-sql03 BI ERP vba.odc"
'.SourceDataFile = ""
.MaxDrillthroughRecords = 1000
.ServerCredentialsMethod = xlCredentialsMethodIntegrated
.AlwaysUseConnectionFile = False
.RetrieveInOfficeUILang = True
End With
With ActiveWorkbook.Connections("cs-sql03 BI ERP test")
.Name = "cs-sql03 BI ERP test"
.Description = ""
End With
Workbooks("Book1").Connections.AddFromFile _
"\\cs-dc1\data\users\calves\My Data Sources\cs-sql03 BI ERP vba.odc"
Thank you, in advance, for any guidance you might provide.
Enjoy your day!
Thank you.