title: In VBA, how can one use the Tools --> Office Links --> Analyze it with Microsoft Office Excel
body: <p>I am attempting to export a query from MS Access into MS Excel in a way that does not carry over the Sorting and Grouping. I have noticed this functionality is simply available by opening a query and clicking:</p>
  
  <blockquote>
    <p>Tools --> Office Links --> Analyze it
    with Microsoft Office Excel</p>
  </blockquote>
  
  <p>However, I don't know how to get to this feature of MS Access programmatically using VBA.</p>
  
  <p>I was going to try something like this:</p>
  
  <pre><code> DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
   DoCmd.AnalyseFeatureFunctionHere
  </code></pre>
  
  <p>or</p>
  
  <pre><code> DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
   SysCmd(acAnalyseFeatureFunctionHere)
  </code></pre>
  
  <p>or</p>
  
  <pre><code> DoCmd.OpenQuery "QueryName", acViewNormal, acReadOnly
   Application.AnalyseFeatureFunctionHere
  </code></pre>