write data from excel into text file

mirzao

Active member
Joined
Nov 10, 2005
Messages
44
Location
Malaysia
Programming Experience
Beginner
hello, how to do that? the structure of the table is like the following:

A B C
1 3 5
2 5 6

My code :
<vb>
wrow=1
do
Dim myWriter As StreamWriter = New StreamWriter(sFileName)
While wrow < 4
myWriter.Write(excelWorksheet.Cells(wrow, 1).value & Chr(9) & excelWorksheet.Cells(wrow, 2).Value & Chr(9) & excelWorksheet.Cells(wrow, 3).Value
wrow = wrow + 1
myWriter.Flush()
End While
loop
</vb>
 
Back
Top