Help Sending appointments from Excel to Outlook

merveil

New Member
Joined
Aug 16, 2008
Messages
6
Hi All,
I want to use Excel to send appointments onto MS Outlook after people in my company have submitted their travel authorization report (to block the time they will be away, on their calendar , using the departure date and back-in-the- office date.)

I am sorry if this is an old subject but I have looked at previous solutions suggested on this message board and other parts of the internet, but Excel's VBA compiler has rejected all the codes I tried mainly because of "user-defined type not defined" error messages...in statements such as:

Dim myOlApp As Outlook.Application
Dim myItem As Outlook.AppointmentItem


:confused: I also got error message such as "Run-time error, Object doesn't support this property or method" when I tried this statement:

.Location = Sheets("Sheet1").Range("A2")



----

I would very much appreciate your help on this.

Note: I have Excel 2003, Outlook 2003, and an XP machine.

Thanks in advance!;)
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hello all,
Silly me....
As soon as I posted my question, I stumbled upon a website who helped me solve my problem...
They ask that, in the VBE, the user go to menu Tools->References, search the list for Microsoft Outlook 11.0 Object library and check it...and voila!!!!

Thanks anyway!!!!!!

Aime.
 
Upvote 0
Alright...Now that I was able to run the code below:

Sub addAppt()
Dim oApp As Object
Dim oNameSpace As Namespace
' Dim oFolder As Object
Dim myItem As AppointmentItem

Set oApp = New Outlook.Application
Set oNameSpace = oApp.GetNamespace("MAPI")

'Set oFolder = oNameSpace.GetDefaultFolder(olFolderCalendar)

Set myItem = oApp.CreateItem(olAppointmentItem)

myItem.Subject = Sheets("Itinerary").Range("C106")
myItem.Start = Sheets("Itinerary").Range("C108")
myItem.Duration = Sheets("Itinerary").Range("c110")
myItem.Save
'myItem.Display
End Sub

The appointment goes ONTO MY calendar, instead of the Calendar shared by the company. I had the company's calendar open when I ran the macro but the appointment was still sent to my personal calendar.

Please help me put the "appointment" onto the active calendar (the one opened while I run the macro).

I would very much appreciate your help.

Thanks,
Aime.
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,936
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top