title: How to reset referenced Workbook variables
body: <p>I have a workbook <code>A</code>(A.xlsm) which references the workbook <code>B</code>(B.xlsm) via the <code>Tools -&gt; References</code> menu in the VBA editor. <code>A</code> uses several macros in <code>B</code>. If I close <code>A</code> then <code>B</code> remains open and all variables maintain their current state. Therefore if I open <code>A</code> again, some macros in <code>B</code> will give errors because they have the state from previous incantations which is not compatible with <code>A</code> anymore.</p>
  
  <p>Is there a way to reset <code>B</code> so that all variables are now in the original state?
  Alternatively is there a way to close <code>B</code> once <code>A</code> is closed?</p>