Thursday 15 August 2013

excel vba - Appending a string to the end of a text file for an existing file -



excel vba - Appending a string to the end of a text file for an existing file -

i new vba script, i'm trying append string in existing file. replacing code of older file there many ways in web couldn't create out successfully.

thanks in advance help on code

code is:

sub adddata() dim fso filesystemobject set fso = new filesystemobject dim stream textstream set stream = fso.createtextfile("c:\itscodes.txt", forappending) stream.write ",sdfthis line uses write method53535." stream.close end sub

it's because you're using createtextfile, creates new text file, overwriting file @ same path.

use opentextfile instead.

excel-vba file-io append

No comments:

Post a Comment