title: Is scoping broken in VBA?
body: <p>Say you have this code in a module called <code>Module1</code>:</p>
  
  <pre><code>Option Explicit
  
  Private Type TSomething
      Foo As Integer
      Bar As Integer
  End Type
  
  Public Something As TSomething
  </code></pre>
  
  <p>In equivalent C# code if you made the <code>Something</code> field <code>public</code>, the code would no longer compile, because of <em>inconsistent accessibility</em> - the <em>type</em> of the field being less accessible than the field itself. Which makes sense.</p>
  
  <p>However in VBA you could have this code in <code>Module2</code>:</p>
  
  <pre><code>Sub DoSomething()
      Module1.Something.Bar = 42
      Debug.Print Module1.Something.Bar
  End Sub
  </code></pre>
  
  <p>And you get IntelliSense while typing it, and it compiles, and it runs, and it outputs <code>42</code>.</p>
  
  <p>Why? How does it even work, from a COM standpoint? Is it part of the language specs?</p>