' Use Module2.' ... It does not need to be created.
Dim _value As Integer
' The value is shared.
' Change the value.
_value += 1
Error. We cannot instantiate an instance of a Module. There is no "New" Sub on it. A Module is not a type, but rather an organizational namespace for programs that is shared.
Warning If you try to create a Module, you will get an error. Please consider adding a class to fix this problem.
Module 'Module2' cannot be used as a type.
Discussion. A Module has many rules. For example, it cannot inherit from another module. And you cannot specify the shared keyword on any of its members (they are already shared).
Summary. Modules are common in VB.NET. But more complex data structures are not built with many modules—rather they use classes as building blocks. A module is an organizational construct.