Suddenly clags with a Run Time Error '4160' Bad File name.
When the file name looks PurrFect to me: http://www.tek-tips.com/viewthread.cfm?qid=1574915&page=12 gives the clue.
In the post stamped "21 Oct 09 5:26" Aviator9 says "The problem got fixed thanks to Pesach Shelnitz: The OriginalDocument and RevisedDocument parameters must be Document objects."
I changed my code from
Code: Select all
If blnDocumentsOpenProject(docProject, strProject) Then
If blnProtectedDocument(Documents(strProject)) Then ' RTE 4160
Else
Code: Select all
If blnDocumentsOpenProject(docProject, strProject) Then
'''' If blnProtectedDocument(Documents(strProject)) Then ' RTE 4160
If blnProtectedDocument(docProject) Then
Else
I'm still a trifle mystified.
This is an application that trawls folder trees looking for any sort of file that might contain VBA code (dot, doc, xls, xla, bas, cls, frm, txt etc) and just plods along, night after night.
One file, and it breaks.
P.S. The file was successfully opened, so it doesn't appear to be a corrupt file or a mis-extented file.