Clear History Script causes "File not found" error

I am using a clear history script to cause clients to replicate all documents; however, after the script runs, the next time a client attempts to replicate they get the error message “File not found”.

When having the client clear it manually (File>Replication>History then clear), it works fine. Does anyone know why this script causes the “file not found” error? and is their a way to automate the clearing of the clients replication history?

Thanks

Subject: Here is the script…

Dim session As New NotesSessionDim db As NotesDatabase

Dim rep As NotesReplication

Set db = session.CurrentDatabase

Set rep = db.ReplicationInfo

Call db.Replicate(“Xanadu”) 'name of server

Call rep.ClearHistory()

Call rep.Save()