title: Microsoft Excel Data Connections - Alter Connection String through VBA
body: <p>I have a fairly straightforward question. I am trying to find a way to alter and change a connection string for an existing data connection in an excel workbook through VBA (macro code). The main reason I am trying to do this is to find a way to prompt the user that opens up the workbook to enter their credentials (Username/Password) or have a checkbox for Trusted Connection that would be used in the Connection String of those existing data connections.</p>
  
  <p><img src="https://i.stack.imgur.com/NOcgU.png" alt="Data Connection Properties"></p>
  
  <p>Right now the Data connections are running off a sample user that I created and that needs to go away in the production version of the workbook. Hope that makes sense?</p>
  
  <p>Is this possible? If yes, could you please give me a sample/example code block? I would really appreciate any suggestions at this point. </p>