title: Excel Automation Error
body: <p>I am getting an "Automation Error" on the line <code>rstLgn_details.Open SqlCmd</code></p>
  
  <p>This is the Code.</p>
  
  <pre><code>Call ConnectSS_Param(ThisWorkbook.FullName)    
  
  Set rstLgn_details = CreateObject("ADODB.Recordset")
  Set SqlCmd = CreateObject("ADODB.Command")
  Set SqlparamUserID = SqlCmd.CreateParameter("@UserID", 129, 1, 52, txtUsername.Value)
  
  StrSql = "SELECT Capabilityname,SLAA_EID FORM $Login_Details WHERE SLAA_EID=@UserID"
  
  SqlCmd.ActiveConnection = conndb
  SqlCmd.CommandText = StrSql
  SqlCmd.Parameters.Append SqlparamUserID            
  
  rstLgn_details.Open SqlCmd
  
  If rstLgn_details.RecordCount &gt; 0 Then         
     UserName = rstLgn_details(1)
     CapHlded = rstLgn_details(0)
     ThisWorkbook.Sheets("Serach").Select
  Else  
     MsgBox "Sorry You are Not Authorized for this..... ", vbInformation + vbOKOnly, "Invaild User"
  End If
  </code></pre>