title: VBA module that runs other modules
body: <p>I'm programming in Microsoft VBA. At first I need to generate a QueryTable with the help of a macro (I've got the code for that) and after that with the help of macros I need to apply formulas that use the data in the QueryTable. The problem that I am facing is that the QueryTable appears only after the Sub, in which its code is, has finished working. That means that I cannot include the code that generates formulas in it, because there is no data for the formulas to be generated on.</p>
  
  <p>The idea right now is to write a module that runs other modules:</p>
  
  <pre><code>Sub moduleController()
      Run "Module1"
      Run "Module2"
  End Sub
  </code></pre>
  
  <p>This gives the error:</p>
  
  <blockquote>
    <p>Run time error 1004 - cannot run the macro "macroname". The macro may not be available in this workbook or all macros may be disabled.</p>
  </blockquote>
  
  <p>What could be the solution? Maybe there is another solution for my QueryTable loading problem?</p>