View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Excel to Schedule Task in Outlook

I get this message:
Automation error. The specified module could not be found.

When I run this code:
Sub CreateTask()
Dim objApp As Outlook.Application
Dim objTask As Outlook.TaskItem

Set objApp = CreateObject("Outlook.Application")
Set objTask = objApp.CreateItem(olTaskItem)
With objTask
.Subject = "Subject"
.StartDate = CDate(ProximaFechaAcumulada) - CDate(15)
.DueDate = CDate(ProximaFechaAcumulada)
.Importance = olImportanceHigh

.Body = "Body" 'Here I need Right to Left

.Save
.ReminderSet = True
End With
End Sub

It fails on this line:
Set objApp = CreateObject("Outlook.Application")

I dont understand this behavior. I have checked the Reference to MS
Outlook Object Library on my system and Im having a problem with the code.
I tried to create a small tool to simplify things in our office, but it just
doesnt seem to work right. When I go to a few other machines in the office
it runs fine. I cant tell whats going on. Perhaps there is some kind of
esoteric setting that is different on my workstation... Id appreciate it if
someone could share some insight.


Regards,
Ryan--

--
RyGuy