Can you clarify: Do you mean it used to work for
you? Do you mean that
you previously have run the macro and had the macro working without error?
You could try this quick test. It might help take us further, although I am not sure how, because I don’t relay know what’s going on..
This modified macro should tell you if you have a file to be killed, just before the code line to kill which is giving you the error.
It should tell you that you have at least one file there.
........
This is the new bit
Code:
' Test section
Dim FileExistTest As String: Let FileExistTest = Dir(strPath & "\" & strDocumentName & ".htm*", vbNormal)
If FileExistTest = "" Then MsgBox Prompt:="You don't seem to have any files to be killed": Debug.Print "You don't seem to have any files to be killed"
Do While FileExistTest <> ""
MsgBox Prompt:="You have this file to be killed: " & FileExistTest: Debug.Print "You have this file to be killed: " & FileExistTest
Let FileExistTest = Dir ' The use of Dir on its own, without any bracket ( ) stuff tells VBA to look again for the next file of the same type and in the same place that it looked the last time
Loop
Bookmarks