SQL Analysis services provide Tabular and MDX models to be consumed in sharepoint or other such tools. However there might be instances where users want to consume them directly via excel. However creating a data connection in excel requires knowledge connection string variables.   With Self-Service BI getting prominance there is a clamour for exposing semantic models directly to end users. The code here extracts the SSAS semantic model metadata and binds it as data connection in excel for the end user.