title: Connect to Redshift using excel vba
body: <p>I am using VBA to programatically connect to redshift database. I am using Postgresql driver. Here is my code:</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  
      Dim rs_opex As Worksheet
      Set rs_opex = ThisWorkbook.Sheets("OPEX")
  
      'Declare Variables
      Dim objMyconn As Object
      Dim objMyCmd As Object
      Dim objMyRecordset As Object
  
      Set objMyconn = CreateObject("ADODB.Connection")
      Set objMyCmd = CreateObject("ADODB.Command")
      Set objMyRecordset = CreateObject("ADODB.Recordset")
  
        objMyconn.ConnectionString = "DRIVER={PostgreSQL Unicode};" &amp; _
              "SERVER=something;" &amp; _
              "DATABASE=whatever;" &amp; _
              "USER=sawantdr;" &amp; _
              "PORT=1234;" &amp; _
              "PASSWORD=abc1234;" &amp; _
              "Option=0"
  
          objMyconn.Open
  
  
  End Sub
  </code></pre>
  
  <p>I get an error saying <a href="https://i.stack.imgur.com/aRkJb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aRkJb.png" alt="enter image description here"></a></p>
  
  <p>I think it might be due to SSL being off. Is there a way to turn on SSL programtically or I am doing something else wrong? Please let me know if more info is required.</p>