title: How to refer to a Excel Worksheet by its VBA Object Name in another Workbook?
body: <p>I have two Excel Workbooks:</p>
  
  <ol>
  <li><code>Source.xlsx</code></li>
  <li><code>Tool.xlsm</code></li>
  </ol>
  
  <p><code>Source.xlsx</code> contains a Worksheet with the VBA Object Name <code>shtTests</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/BltUr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BltUr.png" alt="Screenshot of VBA Properties for shtTests"></a></p>
  
  <p>Let's assume that in <code>Tool.xlsm</code> I have a variable that contains a reference to the Workbook stored in <code>Source.xlsx</code>:</p>
  
  <pre><code>Dim wkbSource as Workbook
  Set wkbSource = GetSourceWorkbook() ' Some function that gives a reference to the workbook
  </code></pre>
  
  <p><strong>Core Question:</strong> How can I reference <code>shtTests</code> within <code>Tool.xlsm</code> by using <code>shtTests</code>' <em>VBA Name</em>?</p>
  
  <hr>
  
  <p>Or to formulate the question as code... assume you have this code snippet:</p>
  
  <pre><code>Dim wkbSourceShtTests as Worksheet
  Set wkbSourceShtTests = GetShtTestsFromWkbSources(wkbSources)
  </code></pre>
  
  <p><strong>Question:</strong> What does <code>GetShtTestsFromWkbSources</code> have to look like?</p>
  
  <hr>
  
  <p><strong>Note:</strong> I do <strong>not</strong> want to reference it by its Excel Name like you would do using <code>wkbSources.Worksheets("Test Cloning")</code> because people might change its Excel Name some day.</p>