Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default writing to txt files


Open sFile(2) For Append As #1
To Append (add to the bottom of an existing text file

Open "C:\tempfolder\temp.txt" For Append As #

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default writing to txt files

I am wanting to write to the end of an existing text file. the following
works however I am sure their is a better way. i.e. not having to open it
twice!!


Open "C:\tempfolder\temp.txt" For Input As #1
iData = ""
Do While Not EOF(1)
Line Input #1, textLine
iData = iData & textLine
Loop
Close #1

Open "C:\tempfolder\temp.txt" For Output As #1
Print #1, iData & Chr(10) & iHist
Close #1


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing a UDF Hajiki Excel Discussion (Misc queries) 3 June 16th 08 06:18 PM
Writing UDF Help jlclyde Excel Discussion (Misc queries) 4 April 22nd 08 08:30 PM
q; Writing to files JIM.H. Excel Discussion (Misc queries) 1 April 23rd 07 10:36 PM
Writing to csv Jeff Excel Discussion (Misc queries) 2 March 16th 07 01:35 PM
Writing to a database Jeff Excel Discussion (Misc queries) 0 February 12th 07 03:35 PM


All times are GMT +1. The time now is 11:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"