Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create and write a simple text file in Excel/VBA
Hi,
what is the easiest way to create a new text file, write one string into the file and close it afterwards? Regards, Thomas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create and write a simple text file in Excel/VBA
Hi Thomas
have a look at the Write method in the VBA help (included an example for this) -- Regards Frank Kabel Frankfurt, Germany Thomas Wieser wrote: Hi, what is the easiest way to create a new text file, write one string into the file and close it afterwards? Regards, Thomas |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create and write a simple text file in Excel/VBA
Dim F1 As Integer
F1 = FreeFile Open "fullpathname\filename.txt" For Output As F1 Print #F1, "Test line" 'Prints: Test Line Print #F1, yourvariable 'Prints: the value of your variable Print #F1, "The vaue of yourvariable is: " & yourvariable 'Prints: the concatation of "quoted" and yourvariable Close #F1 F1 = 0 Thomas Wieser wrote: Hi, what is the easiest way to create a new text file, write one string into the file and close it afterwards? Regards, Thomas |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create and write a simple text file in Excel/VBA
Hi Thomas,
From Help FileNumber = FreeFile Open "C:\My Documents\TEST10" For Output As #FileNumber Write #FileNumber, "This is a sample." Close #FileNumber -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Thomas Wieser" <wernze.nospam@gmx_net wrote in message y.telekom.at... Hi, what is the easiest way to create a new text file, write one string into the file and close it afterwards? Regards, Thomas |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create and write a simple text file in Excel/VBA
Hi to all,
thanks a lot! Regards, Thomas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I use Excel to create this text file? | Excel Worksheet Functions | |||
how to write other language in text file from VBA | Excel Programming | |||
write 1-dimensional array of integers to text file | Excel Programming | |||
opening and write to a text file in excel | Excel Programming | |||
write a line from Excel to a text file | Excel Programming |