+ Reply to Thread
Results 1 to 1 of 1

Exporting calendar from Excel to Outlook

  1. #1
    Registered User
    Join Date
    05-11-2015
    Location
    Denmark, KBH
    MS-Off Ver
    2013
    Posts
    8

    Exporting calendar from Excel to Outlook

    Hi Guys

    I'm what you would call an VBA novice, and thus in need of your help. I need a piece of code that will export appointments (shifts) from excel into my Outlook calendar. So far, I've managed to write something that exports what I need, but I can't work out how to schedule it to the correct start and end times. The piece of code I have so far just places the shifts at 00:00 because i haven't defined start and end time because I don't know how.

    The code I have is:

    Option Explicit

    Sub CalendarExport()
    Dim oOL As Outlook.Application, oAppoint As Outlook.AppointmentItem
    Dim oWS As Worksheet, r As Long, i As Long, sStart As String
    Set oWS = Sheet1
    r = oWS.Range("A1").CurrentRegion.Rows.Count
    Set oOL = New Outlook.Application
    For i = 2 To r
    Set oAppoint = oOL.CreateItem(olAppointmentItem)
    With oAppoint
    sStart = oWS.Cells(i, 2)
    sStart = Left(sStart, Len(sStart) - 4) & Year(Date)
    .Start = CD(sStart)
    .Subject = oWS.Cells(i, 1)
    .Location = "Power Ops"
    .MeetingStatus = olNonMeeting
    .ReminderSet = True
    .Save
    End With
    Next i
    Set oOL = Nothing
    End Sub


    Help of any kind would greatly be appreciated. I have attached the workbook as an example of what I'm trying to accomplish.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Exporting Shared Calendar from outlook
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2015, 05:52 AM
  2. Excel Calendar for Exporting to Outlook issues
    By Syringa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-26-2013, 02:20 AM
  3. Exporting Excel data into Outlook calendars: Changing an Outlook VBA to Excel VBA
    By spaceporker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-19-2012, 11:39 PM
  4. Replies: 0
    Last Post: 08-06-2012, 07:20 PM
  5. Exporting data to Outlook Calendar
    By LexGirard in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 09-20-2009, 07:36 PM
  6. [SOLVED] Exporting a date field in Excel to an Outlook Calendar?
    By rkellie in forum Excel General
    Replies: 0
    Last Post: 10-25-2005, 04:05 PM
  7. Exporting Excel Schedule to Outlook Calendar Subfolders
    By littlegreenmen1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2005, 03:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1