title: Add excel workbook to VB .NET application
body: <p>I have a project written in Vb .NET in which I take input from the user, open a Excel template and run a macro in it(vba) with input from main form.
  I can do all of this without a problem using a path to the template but I need it to be part of the project when I publish it.
  This is my path version code(excess code deleted):</p>
  
  <pre><code>Imports Excel = Microsoft.Office.Interop.Excel
  private sub OpenExcel()
  Dim objApp As Object
          Me.Hide()
          objApp = CreateObject("Excel.Application")
          objApp.WorkBooks.Open("ExampleWorkBook.xlsm")
          objApp.visible = True
          objApp.Run("MacroName", Var1, Var2)
          Me.Close()
  End Sub
  </code></pre>
  
  <p>I have found <a href="https://stackoverflow.com/questions/35499147/add-excel-workbook-to-vb-net-application">this post</a> but it doesn't work, maybe because my templates are in a folder(which is located in same location as form1.vb etc).
  My templates must be separate from other files so they are easy to find.
  If anyone could provide me with a solution/modify code from other post in such a way it works I would be really thankful</p>
  
  <p>I'm using Visual Studio 2017 and Excel 2010
  Code from linked post:</p>
  
  <pre><code>Dim filename as String = My.Application.Info.DirectoryPath &amp; System.IO.Path.DirectorySeparatorChar &amp; "WorkbookName.xlsx"
  Process.Start(filename)
  </code></pre>