I found the line you were referring to in the "processACL" function and added the call to save the ACL however it did not help. Permission was still denied.
The only work around I have creates a template file from the original, NOT from the recently made '.nsX' file:
Dim tmpStr As String
tmpStr = Strleft (FileName , ".ns" )
'Name FileName As Strleft (FileName , ".ns" ) + ".ntf"
'Name FileName As tmpStr + ".ntf"
Set DBCopy = ProcessedDB.CreateCopy( "", tmpStr + ".ntf")
DBCopy.Title = DBCopy.Title + " Template " + ReleaseNumber
This is not satisfactory if I actually want an R4, R5 or R6 template. In which case I need to do it manually from the 'nsX' file once it is created. With the above I am at least getting version control stored zip files.
The error occurs because something has generated a file handle on the 'nsX' file and has subsequently not let go. Even to delete the generated 'nsX' file I have to shut Windows File Explorer and Lotus Notes and then re-open them.