title: Upload Excel Data into DB2
body: <p>I have a following question. Is there any way to change the below code in order to upload excel spreadsheet data into DB2 database? The below code downloads data from DB2 to excel spreadsheet. </p>
  
  <p>I would like to download data to excel, manipulate it in excel and finally upload into database</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Sub CreateQueryTableWithParameters()
      Dim qryTable As QueryTable
      Dim rngDestination As Range
      Dim strConnection As String
      Dim strSQL As String
      
      With Sheets("Sheet1")
          .Activate
          .Range("A:XFD").Clear
          
      End With
      
      
  ' Define the connection string and destination range.
  strConnection = "ODBC;DSN=RDBWC;UID=;PWD=;DBALIAS=RDBWC;"
  
  Set rngDestination = Sheet1.Range("A1")
  ' Create a parameter query.
  strSQL = "SELECT *"
  strSQL = strSQL &amp; " FROM PDB2I.DI_NOS_OST_MVT_01 "
  
  
  ' Create the QueryTable.
  Set qryTable = Sheet1.QueryTables.Add(strConnection, rngDestination)
  
  ' Populate the QueryTable.
  qryTable.CommandText = strSQL
  qryTable.CommandType = xlCmdSql
  qryTable.Refresh False
  
  End Sub</code></pre>
  </div>
  </div>
  </p>