title: Excel VBA that works like scheduling assistant of Outlook
body: <p>'m really new at creating VBA codes and cannot write one alone. Is it possible to create a VBA code that works like Outlook's scheduling assistant? I want it to work like the scheduling assistant. I tried freebusy but it shows "Object does not support this method"</p>
  
  <p>Im at this part where i can send the details using excel info.</p>
  
  <pre><code>    Option Explicit
  
      Sub AddAppointments()
  
        Dim myoutlook As Object ' Outlook.Application
        Dim r As Long
        Dim myapt As Object ' Outlook.AppointmentItem
        Dim time As String
  
        ' late bound constants
        Const olAppointmentItem = 1
        Const olBusy = 2
        Const olMeeting = 1
  
        ' Create the Outlook session
        Set myoutlook = CreateObject("Outlook.Application")
  
        ' Start at row 2
        r = 2
  
        Do Until Trim$(Cells(r, 1).Value) = ""
          ' Create the AppointmentItem
          Set myapt = myoutlook.CreateItem(olAppointmentItem)
          ' Set the appointment properties
          With myapt
            .Subject = Cells(2, 1).Value
            .Location = Cells(3, 1).Value
            .Start = Cells(4, 1).Value
            time = .Start
            .Duration = Cells(5, 1).Value
            .Recipients.Add Cells(8, 1).Value &amp; ";" &amp; _
            Cells(8, 2).Value &amp; ";" &amp; _
            Cells(8, 3).Value &amp; ";" &amp; _
            Cells(8, 4).Value &amp; ";" &amp; _
            Cells(8, 5).Value &amp; ";" &amp; _
            Cells(8, 6).Value &amp; ";" &amp; _
            Cells(8, 7).Value &amp; ";" &amp; _
            Cells(8, 8).Value &amp; ";" &amp; _
            Cells(8, 9).Value &amp; ";" &amp; _
            Cells(8, 10).Value
  
            .MeetingStatus = olMeeting
            ' not necessary if recipients are email addresses
            myapt.Recipients.ResolveAll
            'myapt.Recipients.FreeBusy = "(#8/8/2015#, 60, False)"
           ' .AllDayEvent = Cells(9, 1).Value
  
            ' If Busy Status is not specified, default to 2 (Busy)
            If Len(Trim$(Cells(5, 1).Value)) = 0 Then
              .BusyStatus = olBusy
            Else
              .BusyStatus = Cells(5, 1).Value
            End If
  
            If Cells(6, 1).Value &gt; 0 Then
              .ReminderSet = True
              .ReminderMinutesBeforeStart = Cells(6, 1).Value
            Else
              .ReminderSet = False
            End If
  
            .Body = Cells(7, 1).Value
            .Save
            r = r + 1
            .Display
          End With
        Loop
      End Sub
  </code></pre>