title: Managing user-defined types across various modules
body: <p>What is the best way to manage common user-defined types across VBA modules?</p>
  
  <p>I use the same user-defined types in different modules. For example, I often need to represent (x,y) points, so I end up having this <code>Type</code> in different modules: </p>
  
  <pre><code>Type XYpointType
      x As Double
      y As Double
  End Type
  </code></pre>
  
  <p>I pass arguments of type <code>XYpointType</code> to and from subs and functions in different modules. </p>
  
  <p>However, I suspect this is a poor way to manage user-defined types. The exact same <code>Type</code> definition code ends up in many different modules. </p>
  
  <p>Alternatively, I could have this <code>Type</code> declaration in a single, central "types" module, and all other modules needing this particular type should refer to the types module. The downside is that each module loses its "modularity" in that it must be accompanied byt the "types" module wherever it goes.</p>
  
  <p>Any suggestions?</p>