title: How to generate the range selection dialog box using vba in Excel?
body: <p>I have connected excel with mssql 2008 database and now the data is filled into excel but it is not a table. I want to create a table automatically when the data load.I have used</p>
  
  <blockquote>
    <p>where xlWs is excel worksheet</p>
  </blockquote>
  
  <pre><code>Sub CreateTable(ByRef xlWs As Object)
      xlWs.ListObjects.Add(xlSrcRange, , , xlYes).Name = _
          "Table1"
          'No go in 2003
      xlWs.ListObjects("Table1").TableStyle = "TableStyleLight2"
  End Subs into excel.
  </code></pre>
  
  <p>To make the data into table but it does not display any range dialog as it would do if I would create table using GUI. How to display such dialog?</p>