vba - Automation Error when GetObject Outlook from Excel -
i'm writing vba code in excel send outlook mail based on information in excel file. ok, works on computer , others. there's 1 computer got error when getobject outlook application.
the error "automation error"
the code looks this:
dim olapp outlook.application dim oltask outlook.taskitem on error resume next 'check if outlook running - **the code stopped here** set olapp = getobject("outlook.application") if err <> 0 'if not running, start set olapp = createobject("outlook.application") end if set oltask = olapp.createitem(oltaskitem)
make sure reference set
microsoft outlook object library
microsoft word object library
microsoft excel object library
set fso = createobject("scripting.filesystemobject")
Comments
Post a Comment