Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Import Calendar from Excel

Hello,

I have a simple excel sheet with 3 Columns containing date, time &
meeting requests that goes through the year. The meetings are not
recurring and have different subjects. I was wondering if I could
import this schedule into Outlook so that the reminders will pop up
just like any other meeting request. Thanks for your help.

-- Imran

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Import Calendar from Excel

Imran,

Try something like the following. You'll need to set a reference to the
Outlook object library. In VBA, go to the Tools menu, choose References, and
scroll down to and check "Microsoft Outlook N Object Library" where 'N' is
your version of Outlook. The code below assumes that the appointment date
is in column A, the time is in column B, and the subject is in column C,
starting in row 2 on Worksheet(1).

In the GetObject and CreateObject lines of code, change the "12" to your
version of Outlook (12 = 2007, 11 = 2003, 10 = 2002, 9 = 2000, 8 = 97).

Dim OTL As Outlook.Application

Sub AddMeetings()

Dim Rng As Excel.Range
Dim Appt As Outlook.AppointmentItem

Set Rng = ThisWorkbook.Worksheets(1).Range("A2")
If OTL Is Nothing Then
On Error Resume Next
Err.Clear
Set OTL = GetObject(, "Outlook.Application.12")
If OTL Is Nothing Then
Err.Clear
Set OTL = CreateObject("Outlook.Application.12")
If OTL Is Nothing Then
MsgBox "Unable To Reference Outlook Application"
Exit Sub
End If
End If
End If

Do Until Rng.Value = vbNullString
Set Appt = OTL.CreateItem(olAppointmentItem)
Appt.Start = Rng.Value + Rng(1, 2).Value
Appt.End = Appt.Start + TimeSerial(1, 0, 0)
Appt.Subject = Rng(1, 3).Text
Appt.Save
Set Rng = Rng(2, 1)
Loop

End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

wrote in message
oups.com...
Hello,

I have a simple excel sheet with 3 Columns containing date, time &
meeting requests that goes through the year. The meetings are not
recurring and have different subjects. I was wondering if I could
import this schedule into Outlook so that the reminders will pop up
just like any other meeting request. Thanks for your help.

-- Imran



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to import appt to outlook calendar from excel? marlowisws Excel Discussion (Misc queries) 0 September 26th 06 04:04 PM
Can I import many items into an Excel spreadsheet as a calendar? Katydid Excel Programming 0 January 27th 06 09:01 PM
Can I import a calendar into excel 2002 RichardS Excel Programming 0 November 28th 05 08:32 AM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM
How do I import data from Calendar into Excel Piet Snyman Excel Programming 1 January 25th 05 03:46 PM


All times are GMT +1. The time now is 08:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"