title: Create non-duplicate appointments from list in worksheet
body: <p>I am trying to make appointments from a given date.</p>
  <p>To avoid duplicates I tried coloring the cells but that does not seem viable.</p>
  <p>Now I am trying to check if an appointment with the same &quot;subject&quot; as the cell exists and if so go to the next line.</p>
  <p>I get the error</p>
  <blockquote>
  <p>Object required</p>
  </blockquote>
  <pre class="lang-vb prettyprint-override"><code>Private Sub Workbook_Open()
      Set myOutlook = CreateObject(&quot;Outlook.Application&quot;)
      r = 2
            
      Do Until Trim(Cells(r, 8).Value) = &quot;&quot;   
          If Cells(r, 9).Value = myapt.Subject = Cells(r, 9).Value Then
              r = r + 1      
          Else
              Set myapt = myOutlook.createitem(1)
              
              myapt.Subject = Cells(r, 9).Value
              myapt.Start = Cells(r, 8).Value
              myapt.AllDayEvent = True
              myapt.BusyStatus = 5
              myapt.ReminderSet = True
              'myapt.Body = &quot;&quot;
              myapt.Save
              
              Cells(r, 8).Interior.ColorIndex = 4
              r = r + 1
          End If    
      Loop
  End Sub
  </code></pre>