Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Barb but does not help for several reasons.
Outlook is a single instance programme so CreateObject will return a currently running instance if there is one or start outlook if it isn't running. Outlook is running on the desktop at all times. Code only fails when run via a scheduled task. If I do use GetObject I recieve a different message viz: Error # 429 was generated by VBAProjectActiveX component can't create object I think this is to do with preventing code running in the background sending emails but I want to be able to give my code permission. "Barb Reinhardt" wrote: You may want to check if an instance of outlook is already running. Try something like Set OutApp = nothing on error resume next Set OutApp = GetObject(, "Outlook.Application") On error goto 0 if OutApp is nothing then Set OutApp = CreateObject("Outlook.Application") end if -- HTH, Barb Reinhardt "Old Man River" wrote: "Error # 70 was generated by VBAProjectPermission denied" Is generated when the statement Set OutApp = CreateObject("Outlook.Application") Is executed in a scheduled task but not when the Auto_Open macro in excel is triggered any other way. What do I need to do to enable me to get permission. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
use vba to run a windows scheduled task | Excel Programming | |||
Scheduled Task Saving from a Macro | Excel Programming | |||
Pivot Table through Scheduled Task | Excel Discussion (Misc queries) | |||
Scheduled task hanging | Excel Programming | |||
Scheduled Task | Excel Programming |