This is using data from an access databasse in an excell table. I'm asking here because I have the most faith in this forum
This code here checks if a "site" exists already before uploading new apointments. The problem now is, If we have been there in previous months it wont put it in again with the new date. The site name is in column A and the date of the work to be done there is in G.
Can this code be apapted to check that both of these are the same, then ignore the ones that have a matching site name AND date?
It's quite urgent i find a solution to this as I'm dealing with a lot of data and need to make sure its correct.
Code:
Private Function CheckAppointment(ByVal argCheckData As Variant) As Boolean
Dim oApptItem As Object 'Outlook.AppointmentItem
Dim oFolder As Object 'Outlook.MAPIFolder
Dim oItem As Object
'On Error Resume Next
Set oFolder = oNS.GetDefaultFolder(&H9) 'olFolderCalendar
Application.StatusBar = "Checking " & argCheckData
CheckAppointment = False
For Each oItem In oFolder.Items
If oItem.Class = &H1A Then ' 26 - olAppointment
If oItem.Subject = argCheckData Then
CheckAppointment = True
Exit For
End If
End If
Next oItem
Set oApptItem = Nothing
Set oFolder = Nothing
Set oItem = Nothing
End Function
any help appreciated.