title: Excel VBA Open xlsx File From Folder Without writing Path
body: <p>I want to open Excel xlsx file without writing path by using variables. I din't know why but it is not working. I have a folder with the main workbook and another one that I want to open that is xlsx. I want to name it UnionWB.</p>
  
  <pre><code>  Private Sub cmdStartMonth_Click()
      'Optimize Macro Speed
      Application.ScreenUpdating = False
      Application.EnableEvents = False
      'Analyze month by selecting
      Dim myPath As String
      Dim myFile As String
      Dim UnionWB As Workbook
      Dim MonthName As String
      MonthName = ListMonth.Value
      myExtension = "*.xlsx*"
      Set UnionWB = Workbooks.Open(ThisWorkbook.Path &amp; myExtension)
  
      Application.ScreenUpdating = True
      Application.EnableEvents = True
      End Sub
  </code></pre>
  
  <blockquote>
    <p>Set UnionWB = Workbooks.Open(ThisWorkbook.Path &amp; myExtension)</p>
  </blockquote>