Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA, how to concatenate exports to a text file (no overwrite !)

Status
Not open for further replies.

Benouche

Programmer
Aug 6, 2002
48
FR
Hi,

I need to periodically export to a text file datas from a report.
I don't want to overwrite the existing text file when I do this export, but only to add the new informations ...

How to do it ????
I guess it should be possible in a vba macros.

Thanks in advance !
Benouche
 
To open a file for sequential access from VBA you use the Open statement:
Open filename For [Input, Output, Append] As filenumber
You must Close all files you Open before reopening the files for another type of operation. Stick to your guns
 
You could use the current date in the filename - just remember to format it first

strfilename="whatever" & format$(date,"yyyymmdd") & ".txt"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top