LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Excel and Outlook

Correction on my last message (if it shows up).

Change "For X = 1 To R" to "For X = 11 to R"

Steve


"Steve" wrote in message
...
I adjusted the code to the following:

Sub ScheduleAppts2()
Dim ol As New Outlook.Application
Dim ns As Outlook.Namespace
Dim olFolder As Outlook.MAPIFolder
Dim appt As Outlook.AppointmentItem
Dim R As Integer
Dim X As Integer

R = Range("A65536").End(xlUp).Row

Set ns = ol.GetNamespace("MAPI")
Set olFolder = ns.GetDefaultFolder(olFolderCalendar)

For X = 1 To R
Set appt = olFolder.Items.Add
With appt
.Start = Sheets("Sheet1").Cells(X, 1).Value
.Location = Sheets("Sheet1").Cells(X, 4).Value
.Save
End With
Next X

Set ol = Nothing
Set ns = Nothing
Set appt = Nothing
End Sub

the times start at a11 and the locations start at d11. I am getting a
runtime 13 at the line " .Start = Sheets("Sheet1").Cells(X, 1).Value".

Thanks for any help.
Steve

"Steve Yandl" wrote:

The subroutine should work fine with Office 2000; you just needed to put
a
check mark next to "Outlook 9.0 object library" and click OK.

The time values in column A need to be both a date and time of day for an
appointment to show up where you want. For example, "9:30am 1/5/2005".
After running the macro from Excel, you should be able to open Outlook,
pull
up the calendar and check the appointments.

Steve



"Steve" wrote in message
...
Perhaps I should mention that I am working in Office 2000. I am not
sure
if
that makes a difference. The only Outlook reference i could locate was
outlook 9.0 object library. When I run the macro it seems to run just
find.
Meaning, I get no errors. However, I cannot track down where the
appointments
went.

"Steve Yandl" wrote:

Suppose I have start times in Column A and locations for appointments
in
Column B on Sheet 1. The following Macro will find all the times and
locations and set appointment accordingly. You need to set a
reference
to
Outlook from Tools References. You might want "Subject", "Finish
Time"
etc. this is just a start.

Sub ScheduleAppts()
Dim ol As New Outlook.Application
Dim ns As Outlook.Namespace
Dim olFolder As Outlook.MAPIFolder
Dim appt As Outlook.AppointmentItem
Dim R As Integer
Dim X As Integer

R = Range("A65536").End(xlUp).Row

Set ns = ol.GetNamespace("MAPI")
Set olFolder = ns.GetDefaultFolder(olFolderCalendar)

For X = 1 To R
Set appt = olFolder.Items.Add
With appt
.Start = Sheets("Sheet1").Cells(X, 1).Value
.Location = Sheets("Sheet1").Cells(X, 2).Value
.Save
End With
Next X

Set ol = Nothing
Set ns = Nothing
Set appt = Nothing
End Sub


Steve



"Steve" wrote in message
...
Is there a way to link a row or cell of info in excel to an
appointment
pop-up in Outlook. For example, If I have a row of cells with a
times
in
them. Could I get those time to automatically plug in to my outlook
calendar?

Thanks for your help,
Steve








 
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 open in outlook if outlook is running kirk Excel Discussion (Misc queries) 0 May 24th 06 06:42 PM
Outlook 11 Outlook 10 Object Library Compatibility Issues Paul Mac[_4_] Excel Programming 11 May 19th 06 04:27 AM
Send to Outlook 2000 not Outlook Express Jimbo Excel Discussion (Misc queries) 2 January 4th 05 08:19 PM
Late Binding to Outlook from Excel: Outlook modifies email body Lenny Wintfeld Excel Programming 0 December 12th 04 04:03 PM
Display mail application either in Outlook, or Outlook express [email protected] Excel Programming 0 April 13th 04 09:50 PM


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

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"