title: MS Excel: using Shell in VBA to run an SSIS package as an embedded object in a worksheet
body: <p><strong>What I'm trying to accomplish:</strong>
  I want to upload an Excel table to a SQL Server database table by pushing a button tied to a VBA macro.  </p>
  
  <p>I want the macro to wait for the process to complete before continuing.</p>
  
  <p><strong>My current method:</strong>
  Currently, I have an SSIS package embedded as an object in a cell behind the button tied to the macro.  My macro is pretty rough at this stage because I'm still trying to figure out how to run the SSIS package without it opening in the default app.  </p>
  
  <p>I want it to run in the background via a shell script.  The macro would wait for a signal from the shell script saying that the upload was successful before continuing.  I had this running previously with the SSIS package as an external file and ran the shell (which worked); but, I really want it to be contained inside the Excel file.</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>Sub UpdateGroupsMacro()
  ActiveWorkbook.Save
  ActiveSheet.Shapes.Range(Array("Object 1")).Select
  Selection.Verb Verb:=Activate
  ' Shell ("DTEXEC.EXE /F " &amp; ActiveWorkbook.FullName &amp; "\xl\embeddings\oleObject1.bin""") &lt;---This wasn't working even when I went one level deeper.
  Application.Wait (Now + TimeValue("00:00:01"))
  Worksheets("Macro").ListObjects("GetGroupsTableCount").Refresh
  End Sub
  </code></pre>