Hi Jochen, thanks for your reply. I set some console messages up so I can see what part of the code it's failing at. I put one of these in at the start of the agent run however it's not even getting that far before it falls over. I think it's falling over when it gets to the dim statements.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim matrix As Variant
Dim mail_doc As NotesDocument
Dim mail_body As NotesMIMEEntity
Dim keywords_db As NotesDatabase, payrollProjectsDB As notesdatabase
Dim keywords_view As NotesView, payrollProjectsView As NotesView
Dim stream As NotesStream
Dim payroll_doc As NotesDocument, payrollProjectsDoc As notesdocument
Dim message As String
Dim testDate As Variant
Dim test As variant
Dim dayHeader As boolean
Dim i As Integer
MsgBox "1111"
Dim payRunView As NotesView
Dim PayRunDoc As NotesDocument
Dim payRunTasks(9) As String, payRunLabels(9) As String
Dim test1 As Variant, test2 As Variant, test3 As Variant
Dim earliestDate As Variant
Dim lateString(0 To 200,0 To 5) As Variant, services As String
Dim count As Integer