View Single Post
  #1   Report Post  
littlegreenmen1
 
Posts: n/a
Default Copying Excel schedules to different Outlook Calendars


I am a contractor and have a schedule in Excel for each of the houses
I'm building. As it is right now, I have a macro that exports all the
relevant information from each of my schedules (one at a time) and
imports it into Outlook. This works just fine. My problem is, I have so
much information on one calendar that it makes it hard to read. I have
setup Outlook Calendar to have a different calendar for each job. How
do I get Excel to send the schedule to it's approriate Calendar (ie:
the Excel schedule for 123 Anywhere St would be copied to the Outlook
Calendar for 123 Anywhere St and not the default calendar). Below is my
existing code that will export everything into just the default
calendar. Thank you for any and all help.

Sub Calendar()
Dim olApp As Object
Dim olApt As Object
Dim x As Integer
Dim olBody As Range
Dim olSubject As Range
Dim olDate As Range
Dim olAddress As Range

EraseCalendar

For x = 3 To 200
Set olSubject = Sheet1.Cells.Item(x, "B")
Set olNotes = Sheet1.Cells.Item(x, "J")
Set olDate = Sheet1.Cells.Item(x, "C")
Set olAddress = Sheet1.Cells.Item(1, "O")
Set olApp = CreateObject("Outlook.application")
Set olApt = olApp.CreateItem(1)

If olDate = "" Then
Exit For
End If

If olSubject = "Start Date" Then
GoTo Label1
End If

If olDate = "Date Required" Then
GoTo Label1
End If

If olDate < Date Then
GoTo Label1
End If

With olApt
.AllDayEvent = True
.Start = olDate
.Subject = olSubject
.Location = olAddress
.Categories = olAddress
.Body = olNotes
.BusyStatus = 0
.ReminderSet = False
.Save
End With

Set olApp = Nothing
Set olApt = Nothing

Label1:
Next x

End Sub


--
littlegreenmen1
------------------------------------------------------------------------
littlegreenmen1's Profile: http://www.excelforum.com/member.php...o&userid=23978
View this thread: http://www.excelforum.com/showthread...hreadid=383982