title: Add CSV Connection to Excel with c#
body: <p>I have tried many methods, I want to add a csv connection to excel with c#
  things I have tried:</p>
  
  <pre><code>string textpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
  string path = textpath + "\\filename.csv"
  </code></pre>
  
  <hr>
  
  <pre><code>string csvconectionstring = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + textpath + ";Extensions=asc,csv,tab,txt;";
                      SaturnAddIn.getInstance().Application.ActiveWorkbook.Connections.Add2("csv", csvconectionstring,null, 6, true, false);
  </code></pre>
  
  <hr>
  
  <pre><code>string csvconectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"text;HDR=Yes;FMT=Delimited";
                      SaturnAddIn.getInstance().Application.ActiveWorkbook.Connections.Add2("csv", csvconectionstring,null, 6, true, false); 
  </code></pre>
  
  <hr>
  
  <p>this is the exception i get</p>
  
  <pre><code>System.ArgumentException was unhandled by user code
    HResult=-2147024809
    Message=The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
    Source=""
    StackTrace:
         at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp; msgData)
         at Microsoft.Office.Interop.Excel.Connections.Add2(String Name, String Description, Object ConnectionString, Object CommandText, Object lCmdtype, Object CreateModelConnection, Object ImportRelationships)
         at Saturn.DataImportForm.CouchImport() in c:\Users\dtaylor\Documents\Visual Studio 2013\Projects\Saturn\Saturn\Saturn\CouchImport.cs:line 43
         at Saturn.DataImportForm.ImportButton_Click(Object sender, EventArgs e) in c:\Users\dtaylor\Documents\Visual Studio 2013\Projects\Saturn\Saturn\Saturn\DataImportForm.cs:line 41
         at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
         at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
         at System.Windows.Forms.Control.WndProc(Message&amp; m)
         at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
         at System.Windows.Forms.Button.WndProc(Message&amp; m)
         at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    InnerException: 
  </code></pre>