Hello all, what's wrong with this code snipplet?
I get object variable or with block variable not set error.

Code:
Dim fso As Object
Dim indexhtml As Object
Dim targethmtl As Object
Set fso = CreateObject("Scripting.FileSystemObject")
indexhtml = fso.createtextfile(strprojectDir & "\index.html")
targethmtl = fso.createtextfile(strprojectDir & "\target0.html")