title: Populate Excel userform listbox with query data - listbox is blank
body: <p>I'm attempting to populate a listbox on a userform in an excel document from a query to SQL server, but the listbox is always blank.  </p>
  
  <p>I'm trying to get a list of locations to populate which I will use to define parameters for a follow on query.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Option Explicit
  Sub Populate_ListBox_From_SQL()
      Dim cnt As ADODB.Connection
      Dim rst As ADODB.Recordset
      Dim stDB As String, stConn As String, stSQL As String
      Dim xlCalc As XlCalculation
      Dim vaData As Variant
      Dim k As Long
  
      'set SQL connection and connection string
      Set cnt = New ADODB.Connection
  
      stConn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DW;Data Source=use-rptdw-00;Use Procedure for Prepare=1;Auto Translate=True;" _
      &amp; "Packet Size=4096;Workstation ID=PI-L-C03RTRD;Use Encryption for Data=False;Tag with column collation when possible=False"
  
      cnt.ConnectionString = stConn
  
      'your SQL statement
      stSQL = "SELECT ldesc FROM fin.location ORDER BY ldesc"
  
      With cnt
          .CursorLocation = adUseClient 'Necesary for creating disconnected recordset.
          .Open stConn 'Open connection.
          'Instantiate the Recordsetobject and execute the SQL-state.
          Set rst = .Execute(stSQL)
      End With
  
      With rst
          Set .ActiveConnection = Nothing 'Disconnect the recordset.
          k = .Fields.Count
           'Populate the array with the whole recordset.
          vaData = .GetRows
      End With
  
       'Close the connection.
      cnt.Close
  
       'Manipulate the Listbox's properties and show the form.
       With UserForm1
          With .ComboBox1
              .Clear
              .BoundColumn = k
              .List = Application.Transpose(vaData)
              .ListIndex = -1
          End With
          .Show vbModeless
      End With
  
      'Release objects from memory.
      Set rst = Nothing
      Set cnt = Nothing
  End Sub
  </code></pre>
  
  <p>Maybe I'm putting the code in the wrong place?  I have it under the base VBA code for the userform.
  Or maybe I need to set properties for the ListBox itself?   </p>
  
  <p>I'm pretty new to VBA so any help would be appreciated</p>