LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel to Outlook VBA giving my Calendar Fits

I've been researching how to create a VBA macro that will use Excel
Data to create an Outlook appointment. So far I've cobbled together a
really great working model that does almost everything I need it too.
Almost.

What I don't get is how to set the start time. When I put in a start
time Outlook seems to ignore it and starts the appointment at 2:24 PM
or 9:24 PM.

If I set the AllDayEvent to True then the day "begins" at 2:24 PM and
ends at the same time on the next day.

I'm sure part of the problem is that my Start is partly a cell
reference and partly not, so I'm not sure how to join the two in VBA.
When I type in #mm/dd/yy hh:mm am/pm# I get the correct time and date,
but without the macro reading the cell reference the entire code is
useless.

I'm very much a novice here, so any help (in plain english) would be
greatly appreciated.

------Code Begins Here------

Sub CreateAppointment()

Dim myOlapp As Object
Dim myitem As Object

Set myOlapp = CreateObject("Outlook.Application")
Set myitem = myOlapp.CreateItem(1)



With myitem
.Body = "Blah Blah Blah..."
.AllDayEvent = False
.Start = Range("='MODIFIER_GRID'!I12") + TimeValue("7:00:00
AM")
.End = .Start + TimeValue("00:30:00")
.Subject = "Final Due Date - C#: " &
Range("='MODIFIER_GRID'!G12")
.ReminderMinutesBeforeStart = 10
.Save

End With

Set myitem = Nothing
Set myOlapp = Nothing

End Sub

 
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
excel and outlook calendar Laurie Excel Discussion (Misc queries) 1 March 30th 09 05:11 AM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
dates from excel onto outlook calendar maureen Excel Discussion (Misc queries) 0 March 23rd 07 05:55 PM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM
Getting Excel to update Outlook Calendar Marcus Excel Programming 6 April 28th 04 02:42 AM


All times are GMT +1. The time now is 02:08 PM.

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

About Us

"It's about Microsoft Excel"