Assign task from excel

mramoxia

New Member
Joined
Jun 1, 2016
Messages
18
Hi,

I've been trying to get a code together for sending a task from an excel sheet to someone via outlook but can't work it out. I've found a couple of codes on here but keep getting errors.

Can anyone help me out?

Code:
Sub tasksend()

Dim objOut As Object
Dim objTask As Object
Dim strbody As String




Set objOut = CreateObject("Outlook.Application")
Set objTask = OutApp.CreateItem(olTaskItem)


strbody = "blah"


With objTask
.Assign
.Subject = Range("E65536").End(xlUp).Offset(0, 0).Value
.Body = strbody
.DueDate = Range("H65536").End(xlUp).Offset(0, 0).Value
.Recipients.Add (Range("M65536").End(xlUp).Offset(0, 0).Value)
'.Send
.Display
End With




Set objTask = Nothing
Set objOut = Nothing




End Sub
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You'll need to change the second SET command to:

Code:
Set objTask = objOut.CreateItem(olTaskItem)
If you still get an error, check that you have the Microsoft Outlook Object Library installed (VBA Editor/Tools/References).
 
Upvote 0
Thanks Chameleon64 - got past that point but then had to make sure that the library was ticked too. Thanks for the help.
 
Last edited:
Upvote 0

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