Appointments

Status
Not open for further replies.

Chrystel

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
Having trouble using macro given for creating appointments from Excel spreadsheet data.
I have copied and pasted the macro below yet keep getting error message "Use-defined type not defined":

Option Explicit
Public Sub CreateOutlookApptz()
Sheets("Sheet1").Select
On Error GoTo Err_Execute

Dim olApp As Outlook.Application
Dim olAppt As Outlook.AppointmentItem
Dim blnCreated As Boolean
Dim olNs As Outlook.Namespace
Dim CalFolder As Outlook.MAPIFolder
Dim subFolder As Outlook.MAPIFolder
Dim arrCal As String

Dim i As Long

On Error Resume Next
Set olApp = Outlook.Application

If olApp Is Nothing Then
Set olApp = Outlook.Application
blnCreated = True
Err.Clear
Else
blnCreated = False
End If

On Error GoTo 0

Set olNs = olApp.GetNamespace("MAPI")
Set CalFolder = olNs.GetDefaultFolder(olFolderCalendar)

i = 2
Do Until Trim(Cells(i, 1).Value) = ""
arrCal = Cells(i, 1).Value
Set subFolder = CalFolder.Folders(arrCal)

Set olAppt = subFolder.Items.Add(olAppointmentItem)

'MsgBox subFolder, vbOKCancel, "Folder Name"

With olAppt

'Define calendar item properties
.Start = Cells(i, 6) + Cells(i, 7) '+ TimeValue("9:00:00")
.End = Cells(i, 8) + Cells(i, 9) '+TimeValue("10:00:00")
.Subject = Cells(i, 2)
.Location = Cells(i, 3)
.Body = Cells(i, 4)
.BusyStatus = olBusy
.ReminderMinutesBeforeStart = Cells(i, 10)
.ReminderSet = True
.Categories = Cells(i, 5)
.Save

End With

i = i + 1
Loop
Set olAppt = Nothing
Set olApp = Nothing

Exit Sub

Err_Execute:
MsgBox "An error occurred - Exporting items to Calendar."

End Sub

Anyone have any ideas?
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
L Option to Show Cancelled Appointments Using Outlook 0
O Export Outlook calendar appointments by filters and date range Outlook VBA and Custom Forms 1
R Outlook 2007 only loads some appointments Using Outlook 0
N Gathering Calendar Appointments from Calendars that synced as Contacts Exchange Server Administration 1
F Year-and-a-day recurring appointments Using Outlook 1
J what file contains contacts, tasks and appointments stored locally? Using Outlook 1
D hiding appointments that are completed or cancelled, how to ? Using Outlook 5
M warning for too many appointments on a same day in Outlook Using Outlook 1
V importing appointments to non-default calendar? Using Outlook 1
OutlookIntegrator Appointments Using Outlook 0
R Make past appointments remain in calendar Using Outlook 1
M Creating Outlook Appointments from Excel Cells Outlook VBA and Custom Forms 1
A Outlook.com changing appointments Using Outlook 8
T populate calendar with appointments and send reminders Using Outlook 1
Diane Poremsky Copy New Appointments to Another Calendar using VBA New Slipstick.com Articles 0
Diane Poremsky Create Appointments Using Spreadsheet Data New Slipstick.com Articles 0
Diane Poremsky How to Import Appointments into a Group Calendar New Slipstick.com Articles 0
I Outlook 2013 Appointments not in HTML Using Outlook.com accounts in Outlook 2
makinmyway Appointments Created in iCloud Calendars Cover Contacts Field...Why? Using Outlook 3
M Expected behaviour of recurring appointments? Using Outlook 2
C Find all deleted recurrence appointments Outlook VBA and Custom Forms 4
M Copy new appointments created in multiple shared calendars to another exchange calendar Outlook VBA and Custom Forms 1
R Outlook calendar appointments Free/Busy time is changing from "Busy" to "Free" Using Outlook 2
G Outlook does not show new appointments in To-Do-Bar Using Outlook 0
A Looping appointments in calendar Outlook VBA and Custom Forms 0
B Outlook Calendar/setting appointments Using Outlook 1
L Appointments disappearing Using Outlook 0
N To do bar - show more than 30 days of appointments Using Outlook 0
A Show ALL of today's appointments in To-Do Bar Using Outlook 1
F Outlook 2007 Calendar Appointments not in Outlook Today view Using Outlook 11
A Can't stop Outlook.com from setting reminders on appointments? Using Outlook.com accounts in Outlook 3
S Outlook 2013 Appointments missing Using Outlook 1
N Outlook Shared appointments automatically to Private Calendar Using Outlook 1
A Synchronize Access Table with Outlook Calendar Appointments Outlook VBA and Custom Forms 3
J Change reminder times of future appointments Using Outlook 1
Mark Rideout Search folder for appointments and emails Using Outlook 2
C Appointments from Excel to Outlook Using Outlook 3
C Appointments Using Outlook 25
I Adding appointments/tasks to other user's calendar Using Outlook 1
R Getting a colleagues appointments and calendar entries Using Outlook 1
N Outlook 2010 Archived Appointments Missing Using Outlook 5
Katrina Fox Missing appointments on calendar even though transferred from old pst Using Outlook 0
Horsepower Setting appointments in calendar Using Outlook 3
W Outlook 2010 - Displaying Private Appointments In Shared Calendars Using Outlook 1
T Synchronize outlook appointments through web application. Using Outlook 1
A OL13 Calendar, won't allow entering 2 appointments consecutively Using Outlook 4
D Help with Contacts and Appointments Using Outlook 0
K Appointments turn into meeting requests Using Outlook 0
R New computer, OL2010 unable to display shared calendar appointments Exchange Server Administration 3
C Calendar is not accepting Appointments Using Outlook 0
Similar threads


















































Top