title: Open an excel workbook after code executes
body: <p>I know this has been asked before, but for the life of me I cannot get this simple code to work. I keep getting the compile error "User-defined type not defined" on <code>Dim wbopen As Workbook</code>
  line. I know the workbook has to be open to define it, and the file path should be Z:\Manufacturing\02- Schedules\01- Buffer Prep
  while the file name is the only .xls in the folder. Why is this happening? Also, this is executing in a Word file. Not sure if that matters. Thanks everyone!</p>
  
  <pre><code>Sub fileopen()
  
  Dim wbopen As Workbook
  Dim strFileName As String
  Dim strFilePath As String
  
  strFilePath = "Z:\Manufacturing\02- Schedules\01- Buffer Prep\"
  
  strFileName = Dir(strFilePath &amp; "*.xls")
  
  Set wbopen = Workbook.Open(strFileName)
  
  End Sub
  </code></pre>