1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Import Excel dates as outlook calender tasks

Discussion in 'Business Applications' started by pjrey, Nov 19, 2010.

Thread Status:
Not open for further replies.
  1. pjrey

    pjrey Thread Starter

    Joined:
    Nov 19, 2010
    Messages:
    1
    Hi Folks,
    I found the following thread:
    http://forums.techguy.org/business-applications/541487-merge-excel-dates-into-outlook.html

    At best I am capable of copy pasting code - and I guess I'm slightly failing at that even.
    I simply wish to be able to update an excel with dates of future tasks, in a particular column, and have these automatically appear as tasks on a particular date in calendar. Ideally column a (name of task) and column F (date in format 1.1.1.) would both be incorporated into the task, which would be allocated to date X in calendar.
    I am using Outlook version 14.0.4734.1000

    I have associated with Outlook 14.0 object library already. This is what i have so far (the first line is incorrect, presumably amongst others):

    Code:
     
    Sub ExportAppointmentsToOutlook(14.0)
        Dim olApp As Outlook.Application
        Dim olApt As AppointmentItem
        Dim blnCreated As Boolean
        
    'Read the table with appointments:
        Dim arrAppt() As Variant, i As Long
        arrAppt = Range("A2", Cells(Rows.Count, "F").End(xlUp)).Value
        On Error Resume Next
        Set olApp = GetObject(, "Outlook.Application")
        If olApp Is Nothing Then
            Set olApp = CreateObject("Outlook.Application")
            blnCreated = True
            Err.Clear
        Else
            blnCreated = False
        End If
        On Error GoTo 0
    'Create the outlook item for the table entries:
    'Rows:
    ' Row 1 = date
    ' Row 2 = starttime
    ' Row 3 = endtime
    ' Row 4 = Description
    ' Row 5 = Location
        For i = LBound(arrAppt) To UBound(arrAppt)
        Set olApt = olApp.CreateItem(olAppointmentItem)
        With olApt
            .Start = arrAppt(i, 1) + arrAppt(i, 2)
            .End = arrAppt(i, 1) + arrAppt(i, 3)
            .Subject = arrAppt(i, 4)
            .Location = arrAppt(i, 5)
            .Body = "Created by excel tool"
            .BusyStatus = olBusy
            .ReminderMinutesBeforeStart = 5
            .ReminderSet = True
            .Save
        End With
        Next i
    
        Set olApt = Nothing
        Set olApp = Nothing
    End Sub
    
            With olApp.CreateItem(olTaskItem)
                .DueDate = arrTasks(i, 1)
                .Subject = arrTasks(i, 2)
                .Save
    '            .Close
            End With
        Next i
        If blnCreated = True Then
            olApp.Quit
        End If
    End Sub
    
    I understand you probably not keen on helping people who have no clue with VB, but at least appreciate my efforts?! I'd greatly appreciate any help with this. Keep in mind I really haven't got a clue.

    Regards,
    Peter
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/963407

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice