I am having trouble opening a blank email message from excel. When I try and run it I get the following error message:
[!]Run-time error '-2113732605 (82030003)'
Automation error[/!]
Can anyine tell me what I am doing wrong?
[!]Run-time error '-2113732605 (82030003)'
Automation error[/!]
Code:
[COLOR=darkblue]Dim[/color] olApp [COLOR=darkblue]As[/color] Outlook.Application
[COLOR=darkblue]Dim[/color] olMail [COLOR=darkblue]As[/color] Outlook.MailItem, olSendTo [COLOR=darkblue]As[/color] Outlook.Recipients
[COLOR=green]'open Outlook[/color]
[COLOR=darkblue]Set[/color] olApp = CreateObject("Outlook.Application")
[COLOR=green]'Create mail message[/color]
[COLOR=darkblue]Set[/color] olMail = olApp.CreateItem(olMailItem)[tab][!]<-- Error Here[/!]
[COLOR=darkblue]With[/color] oMailItem
[COLOR=darkblue]Set[/color] olSendTo = .Recipients.Add("Staff")
olSendTo.Type = olTo
.Subject = sSubject
[COLOR=darkblue]End With[/color]
olMail.Display