Excel to Outlook Apointment but to shared calendar

Garouken

New Member
Joined
Feb 21, 2017
Messages
7
Hi I apologise in advance but my last post got nowhere but probably due to the lack of my actual code.

I have barely managed to find some code that lets me use the data in a table to populate my own calendar in excel please see attached

Code:
Sub Appointments()
 Const olAppointmentItem As Long = 1
 Dim oApp As Object
 Dim OLNS As Object
 Dim oAppt As Object

 

 On Error Resume Next
 Set oApp = GetObject(, "Outlook.Application")
 If oApp Is Nothing Then Set oApp = CreateObject("Outlook.Application")
 On Error GoTo 0
 If Not oApp Is Nothing Then
 
 Set OLNS = oApp.GetNamespace("MAPI")
 OLNS.Logon
 Set oAppt = oApp.CreateItem(olAppointmentItem)
 oAppt.Subject = Range("A2").Value
 oAppt.Start = Range("b2").Value
 oAppt.Duration = Range("c2").Value
  oAppt.Save
 
 

 Set OLAppointment = Nothing
 Set OLNS = Nothing
 Set oApp = Nothing
 End If
 End Sub


The code works great for my own calendar but I require it to instead make appointments on a shared calendar located in
">All Public Folders>WorkForce>WFD>WFD Adults"
with WFD Adults being the calendar name

I am completely stumped everything I have tried has failed and I am in need of someone to save me
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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