How to change the connection string in powerpivot by script?

Discussion How to change the connection string in powerpivot by script?

  • Saturday, December 18, 2010 11:07 PM
     
     
    How to change the connection string in powerpivot by script, so i can put it in one cell ?

All Replies

  • Monday, December 20, 2010 4:35 AM
     
     
    There is no supported API in PowerPivot v1. You can't change anything via script.
    http://geekswithblogs.net/darrengosbell - please mark correct answers
  • Monday, December 20, 2010 10:01 AM
     
     
    Maybe, but the connection is just part of the connections collection, so that is exposed to VBA.
     
    Dim cnn As Object
     
        For Each cnn In ThisWorkbook.Connections
       
            If cnn.Name = "PowerPivot Data" Then 'old versions used 'Sandbox'
           
                MsgBox cnn.OLEDBConnection.Connection
            End If
        Next cnn
     
     
    But I fail to see the logic, there is just the one connection to PowerPivot, and what can you change it to?
     

    HTH

    Bob

    "Darren Gosbell [MVP]" wrote in message news:725ac5b0-8bdf-455b-b487-ff43551c554a@communitybridge.codeplex.com...
    There is no supported API in PowerPivot v1. You can't change anything via script.
    http://geekswithblogs.net/darrengosbell - please mark correct answers
  • Monday, December 20, 2010 10:50 AM
     
     
     But I fail to see the logic, there is just the one connection to PowerPivot, and what can you change it to?


    That's just the connection from the pivot table to the PowerPivot model.

    As I said there is no supported API for PowerPivot, you can't "see" the connects from PowerPivot to the source data.


    http://geekswithblogs.net/darrengosbell - please mark correct answers
  • Monday, December 20, 2010 6:47 PM
     
     
    Which IS the connection string, because it connects to the local cube.
     
    HTH

    Bob

    "Darren Gosbell [MVP]" wrote in message news:d5cf1841-4340-455f-9633-8cbce6cd4f1e@communitybridge.codeplex.com...
    But I fail to see the logic, there is just the one connection to PowerPivot, and what can you change it to?


    That's just the connection from the pivot table to the PowerPivot model.

    As I said there is no supported API for PowerPivot, you can't "see" the connects from PowerPivot to the source data.


    http://geekswithblogs.net/darrengosbell - please mark correct answers
  • Monday, December 20, 2010 8:20 PM
     
     
    Maybe I'm misunderstanding something about the question, but I can't see why you would change that connection string. That connection uses an in-memory transport. I haven't tried, but I suspect that if you change it all that will happen is that the PivotTable will break.
    http://geekswithblogs.net/darrengosbell - please mark correct answers
  • Wednesday, December 22, 2010 9:04 AM
     
     
    That was exactly my point in my original reply.
     
    Bob

    "Darren Gosbell [MVP]" wrote in message news:4d7ff7ee-4af0-4dcd-a96f-f61fc0bcc222@communitybridge.codeplex.com...
    Maybe I'm misunderstanding something about the question, but I can't see why you would change that connection string. That connection uses an in-memory transport. I haven't tried, but I suspect that if you change it all that will happen is that the PivotTable will break.
    http://geekswithblogs.net/darrengosbell - please mark correct answers
  • Wednesday, December 22, 2010 9:49 AM
     
     
    That was exactly my point in my original reply.
     
    Bob

    "Darren Gosbell [MVP]" wrote in message news:4d7ff7ee-4af0-4dcd-a96f-f61fc0bcc222@communitybridge.codeplex.com...
    Maybe I'm misunderstanding something about the question, but I can't see why you would change that connection string. That connection uses an in-memory transport. I haven't tried, but I suspect that if you change it all that will happen is that the PivotTable will break.
    http://geekswithblogs.net/darrengosbell - please mark correct answers


    Which was the point of my original reply.

    The only connections that it makes any sense to change in relation to PowerPivot are those used to populate the model with data. And there is no supported API to change those.


    http://geekswithblogs.net/darrengosbell - please mark correct answers