Set objFSO = CreateObject("Scripting.FileSystemObject") 'Open the input csv file for reading. The file is in the same folder as the script. Set objInFile = objFSO.OpenTextFile(objFSO.GetParentFolderName(WScript.ScriptFullName) &_ "\in.csv",1) 'Create the output html file. Set objOutHTML = objFSO.OpenTextFile(objFSO.GetParentFolderName(WScript.ScriptFullName) &_ "\out.html",2,True) 'Write the html opening tags. objOutHTML.Write "" & vbCrLf 'Declare table properties. objOutHTML.Write "" & vbCrLf 'Write column headers. objOutHTML.Write "" & vbCrLf 'Go through each line of the input csv file and write to the html output file. n = 1 Do Until objInFile.AtEndOfStream line = objInFile.ReadLine If Len(line) > 0 Then token = Split(line,",") objOutHTML.Write "" For i = 0 To UBound(token) objOutHTML.Write "" Next objOutHTML.Write "" & vbCrLf End If n = n + 1 Loop 'Write the html closing tags. objOutHTML.Write "
XYZ
" & n & "" & token(i) & "
" objInFile.Close objOutHTML.Close Set objFSO = Nothing