LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Scheduled task "Error # 70 was generated by VBAProjectPermis

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
use vba to run a windows scheduled task [email protected] Excel Programming 4 May 29th 07 08:18 PM
Scheduled Task Saving from a Macro Max Excel Programming 1 May 21st 07 06:30 PM
Pivot Table through Scheduled Task [email protected] Excel Discussion (Misc queries) 1 October 18th 05 09:27 AM
Scheduled task hanging codemind Excel Programming 3 May 7th 04 03:03 PM
Scheduled Task Matt. Excel Programming 4 April 6th 04 03:07 PM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"