title: 'FileDialog' type is not defined in MS Access
body: <p>In Access 2016, I wish to display the <strong>File Open</strong> dialog, allowing users to select a CSV file to import.  However, an error is being generated in relation to the line <code>Dim FD as Office.FileDialog</code> -</p>
  
  <blockquote>
    <p>Compile error: User-defined type not defined</p>
  </blockquote>
  
  <p>The below code has been copied (and edited slightly) from <a href="https://msdn.microsoft.com/en-us/library/office/ff196794.aspx" rel="noreferrer">the example posted on <strong>MSDN</strong></a>.  This example is listed as relevant for Office 2013 and later, yet the very first comment in the code (in relation to the variable type <strong>Office.FileDialog</strong>) seems to contridict this -</p>
  
  <blockquote>
    <p>Requires reference to Microsoft Office 11.0 Object Library.</p>
  </blockquote>
  
  <p>Surely for Office 2013 you'd need to refernece the MS Office 15 Object Library, and then the respective version library for future versions, such as 2016?</p>
  
  <p>But regardless, in Access 2016 there is no refernece to the Microsoft Office 11.0 Object Library.  There is however a reference to the <strong>Microsoft Access 16.0 Object Library</strong>, which is included.</p>
  
  <p>How can I get the <strong>File Open</strong> dialog to show?</p>
  
  <pre><code>Function SelectFile(Optional ByVal title As String = "Please select a file", _
                      Optional ByVal allowMultiSelect As Boolean = False) As Variant
  
      Dim FD As Office.FileDialog
      Dim file As Variant
  
      Set FD = Application.FileDialog(msoFileDialogFilePicker)
  
      With FD
  
          .title = "Please select a file"         ' Add the dialog title
          .allowMultiSelect = allowMultiSelect    ' Set whether or not to allow multiple file selection
  
          .filters.Clear                      ' Clear any existing filters
          .filters.Add "CSV Files", "*.csv"   ' Add new filters
  
          '**
           ' Show the dialog to the user
           '*
          If .Show = True Then
  
              For Each file In .selectedItems  ' Grab the path/name of the selected file
                  SelectFile = file
              Next
  
          Else
              SelectFile False
          End If
  
     End With
  
     Set FD = Nothing    ' Clean up the FD variable
  
  End Function
  </code></pre>
  
  <p>Here are my currently selected references -</p>
  
  <p><img src="https://i.stack.imgur.com/6Ncm1.png" alt="Selected references"></p>
  
  <p>And here are the available MS Office referencs (no refernece to <strong>Microsoft Office 16.0 Object Library</strong>) -</p>
  
  <p><img src="https://i.stack.imgur.com/rACZu.png" alt="Available MS Office references"></p>