Agent works manually, but not when scheduled?

I have an Agent that copies documents from Database-A to Database-B and then deletes them from Database-A. If I run the Agent manually its works just fine. But as soon as I change that Agent to “Scheduled”, nothing happens. If I check the server log there are no errors, theres not even a log showing it tried to run. I have the schedule set to every 5 minutes during business hours for testing purposes.

I am thinking its somthing to do with the ACL? I dont think anything is wrong with the code, but here it is anyway:

Sub Initialize

Dim archiveDb As New NotesDatabase( "SCILKL1NS/SCI", "JWDtestTo.nsf" )

Dim doc As NotesDocument

Dim item As NotesItem

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView



Set db = session.CurrentDatabase  

Set archivedb = session.GetDatabase( "SCILKL1NS/SCI", "JWDtestTo.nsf" )   

Set view = db.GetView( "PS3_Profiles") 

Set doc = view.GetLastDocument



While Not (doc Is Nothing)

	Set item = doc.ReplaceItemValue( "ArchivedDateFlag", Now )

	Call doc.Save( False,False )

	Call doc.CopyToDatabase( archiveDb )

	Call doc.Remove(True)

	Set doc = view.GetLastDocument

Wend	

End Sub

Subject: Agent works manually, but not when scheduled?

If you are crossing servers to open a database(I see code that looks like it does possibly) your server where code is running must be listed as a trusted server where the code is going.
However it does not even look you are getting that far if no errors are showing up. Put a few print statements at the beginning of your code and see if they appear in your log.

Subject: Agent works manually, but not when scheduled?

type “tell amgr sched” on your domino console, do you see the agent waiting in the queue? If not, then there’s something wrong with the way you have it scheduled like the Server to run on, trigger, don’t run before date specified, day of week to run, etc. Your code looks fine at first glace.

Subject: Agent works manually, but not when scheduled?

Is the agent signed by an ID that can not run agents on the server?That is a common cause for this