ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add .LOG to .txt file on creation (https://www.excelbanter.com/excel-programming/344554-add-log-txt-file-creation.html)

Piranha[_59_]

Add .LOG to .txt file on creation
 

Hi,
In using this code to create and copy data to a .txt file.

I want to (on the inital creation of the file ONLY) insert .LOG

as the first line.


Code:
--------------------
Sub TxtFile()
Dim rrr
Dim MyTest99
Dim MyData
rrr = FreeFile
MyData = Selection

'On only the inital creation of the txt file, I want .LOG inserted

MyTest99 = "E:\backup & testing\test99.txt"
Open MyTest99 For Append Shared As #rrr
Print #rrr, MyData
Close #rrr
End Sub
--------------------

Any direction appreciated.
Dave


--
Piranha
------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=480975



All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com