Re: Object variable or with block variable not set



Set OutApp = nothing
on error resume next
Set OutApp = CreateObject("Outlook.Application")
on error goto 0

if outapp is nothing then
'something very bad happened
else
'it worked ok
end if



Piotr wrote:
>
> Yes I do have Outlook, but i dont know how to check if the CreateObject
> is successful.

--

Dave Peterson
.



Relevant Pages

  • Re: accessing mail through vba
    ... Dim OutMail As Object ... Dim cell As Range ... Set OutApp = CreateObject ... On Error GoTo cleanup ...
    (microsoft.public.word.vba.general)
  • Joining 2 modules as 1 for email with Excel
    ... Dim OutApp As Outlook.Application ... Set OutApp = CreateObject ... On Error GoTo cleanup ... Set OutMail = OutApp.CreateItem ...
    (microsoft.public.excel.programming)
  • accessing mail through vba
    ... Dim OutMail As Object ... Dim cell As Range ... Set OutApp = CreateObject ... On Error GoTo cleanup ...
    (microsoft.public.word.vba.general)
  • accessing mail through vba
    ... Dim OutMail As Object ... Dim cell As Range ... Set OutApp = CreateObject ... On Error GoTo cleanup ...
    (microsoft.public.vb.general.discussion)
  • Re: Annoying as H#LL !!!!
    ... Set DataObj = New MSForms.DataObject ... On Error GoTo 0 ... Set OutMail = OutApp.CreateItem ... Set OutApp = GetObject ...
    (microsoft.public.outlook.program_vba)

Loading