title: Initialising global variables in VBA
body: <p>In Excel 2003, how can I declare global variables and initialise them only once, ie when the workbook is opened?</p>
  
  <p>I have some parameters that are used by a few macros: paths to input files, basically. At the moment, my code looks like this:</p>
  
  <pre><code>global path1, path2 as string
  
  sub initPaths
      path1 = 'path\to\file1'
      path2 = 'path\to\file2'
  end sub
  </code></pre>
  
  <p>Then, whenever I need to use file1 or file2 in a subroutine or function, I insert a call to <code>initPaths</code>. But this seems rather inelegant; I'd like to be able to set the paths only once rather than repeatedly.</p>