olAppointmentItem .Start

ElRugg

New Member
Joined
Jun 26, 2020
Messages
16
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

With an Excel cell currently active, I want to create an Outlook Meeting for that date and time entered. Although it looks like the cell is properly set up with the date format, it's not working.

Here's an abridged version of what I have so far:

VBA Code:
Sub Mtg()

Dim olA As Object
Dim olMt As Object

Set olA = CreateObject("Outlook.Application")
Set olMt = olA.CreateItem(olAppointmentItem)

With olMt
.Start = ActiveCell.Value
.Duration = 30
.Subject = ActiveCell.Offset(0, -8).Value & " - " & ActiveCell.Offset(0, -5).Value
.Location = "Conference Room"
.ReminderSet = True
.Display
End With

End Sub

There's additional code at the beginning to test that the right column is selected and that the active cell isn't blank. That's working as expected though so that's not noted.

When testing, an error comes up at the ".Start" line. It's runtime error 438: object doesn't support this property or method. Since every suggestion seems to use that same property, not sure what I'm missing. Any help would be appreciated!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
If you do not have a reference set to the Outlook object library, then your olApointmentItem constant has no value and will be treated as 0. That means that you will actually get a mailitem, not an appointmentitem. Either set the reference or declare the constant yourself using:

Code:
const olAppointmentitem as long = 1
 
Upvote 0
Solution
I added the Outlook references in another workbook and thought that would transfer over for other workbooks... Clearly I was wrong and thanks for the reminder to check that!
 
Upvote 0

Forum statistics

Threads
1,215,646
Messages
6,126,004
Members
449,279
Latest member
Faraz5023

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