I don't understand how you can get an error when you use (yuck!!) ON ERROR RESUME NEXT. Unless you mean you see the error down at that last line.
Anyway...if the file already exists, then CreateTextFile will fail.
Unless you add another argument to it:
Set objFile=objFSO.CreateTextFile(strFilePath, True)
That TRUE argument says "overwrite if exists".