title: What does the keyword 'New' do in VBA?
body: <p>In VBA procedures we are constantly meeting the keyword <strong>New</strong> usually on instantiation of an object reference to an existing object instance. But in some instantiations we use the keyword New while in others we don't for example:</p>
  
  <p><code>Dim T As Excel.Workbook</code></p>
  
  <p><code>Set T = Application.Workbooks(Bk)</code></p>
  
  <p><em>In the upper example No.1 the <strong>"New"</strong> keyword has <strong>not</strong> been used</em></p>
  
  <p><code>Dim fso As FileSystemObject</code></p>
  
  <p><code>Set fso = New FileSystemObject</code></p>
  
  <p><em>In the upper example No.2 the <strong>New</strong> keyword <strong>is</strong> being used</em></p>
  
  <p>Why that? Keep in mind i'm fresh of the boat in VBA but i will do my best to understand!</p>
  
  <p>In addition to that i also get confused when is used/not-used in declaring an object reference for example:</p>
  
  <p><code>Dim WS As Worksheet</code></p>
  
  <p><em>In the upper example No.1 the <strong>"New"</strong> keyword has <strong>not</strong> been used</em></p>
  
  <p><code>Dim myClassModule As New cl_ChartEvents</code></p>
  
  <p><em>In the upper example No.2 the <strong>New</strong> keyword <strong>is</strong> being used</em></p>
  
  <p>The Microsoft Help just tells me nothing...</p>
  
  <p><em>Keyword that enables implicit creation of an object. If you use New when declaring the object variable, a new instance of the object is created on first reference to it, so you don't have to use the Set statement to assign the object reference.</em></p>
  
  <p>Gratz2u</p>
  
  <p>Dear people just a last dust-off for deep understanding</p>
  
  <p><code>Dim WS as Worksheet</code></p>
  
  <p><code>Set WS = Worksheets("Sheet1")</code></p>
  
  <p>Right here we are creating an object that already existed in order to open MS Excel (lets say for examples sake in "default mode") of course which is Sheet1. <strong>Since it exists and the <code>New</code> keyword is out of the question how could we instantiate this object in one line right away?</strong> </p>
  
  <p>4 @exantas</p>
  
  <p>Sorry says not enough rep to post pic :-(</p>