Try to delete the Personal Address book from temp folder but getting error?

HiFor Citrix environment, I have database where I have attach a template of personal address book. I select a user in my database and detach the pnab in a local drive and create the location and connection doucment as well as update the user mail file and mail server info in address book. Then attach the pnab to user document then other agent detach the pnab to the user citrix folder. But after updating the address book and attach it to document and try to delete the pnab in local folder getting error

Error 4005:File is in use by another programe.

following is part of script.

Here I am updating the pnab…

Dim namesdb As New NotesDatabase(“”,“”)

	Call namesdb.Open("",FulldirnoteFinal & "names.nsf")

	If namesdb.isOpen Then

		Dim namesdoc As NotesDocument

		Dim namesview As NotesView

		namesdb.Title="Personal Address Book"

		Set namesview = namesdb.GetView("Adva_nced\Locations")

		Set namesdoc = namesview.GetFirstDocument

		namesdoc.ImailAddress = doc.CnabInternetAddress(0)

		namesdoc.MailServer = doc.CnabMailServer(0)

		namesdoc.MailFile = doc.CnabMailFile(0)

		Call namesdoc.save(True, False)

		Set namesdoc=Nothing  'addeded 421

	End If

Here deleting the pnab from local drive.

If namesdb.isOpen Then

		Call namesdb.Remove	

	Else

		Call AppendAgentLogMessage(gagentlogdoc,"Error",FulldirnoteFinal & "names.nsf" + " can not delete")

	End If

Any idea why I am getting the error.

Subject: Try to delete the Personal Address book from temp folder but getting error ??

You can’t delete the PNAB when the Notes client is running. Since the PNAB holds location and connection settings it would be bad to delete it while the program is running.

Subject: RE: Try to delete the Personal Address book from temp folder but getting error ??

HiIt not my PNAB, it is template which I detach from the template doucment and make the update on that PNAB attach back to particular user doucment for CITRIX, so after attach i want to delete the PNAB from the local drive.