You need Set
to assign an object to a variable or the function's return value:
OpenFileWrite = objTextFile
==>
Set OpenFileWrite = objTextFile
(In Set OpenFileWrite = objTextFile
the Set
obeys the rule "Use Set to assign an Object"; the OpenFileWrite =
'implements' the rule "assign to the function name to specify the return value".)