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

HI
On the below code I would like to add a variable that uses the value of a
text box from a form:
So the form is AABB the text box is NAME

I have tried to change the code below to
Set a = fs.CreateTextFile("c:\GL1025\& ABB.NAME &".txt", True) but it does
not work
coul you please help?

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\GL1025\testfile.txt", True)
For Each Cell In Range("A1:A65000")
s = Cell.Value
a.WriteLine (s)
Next
a.Close


End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Saving a txt file

There appears to be a typo :
Set a = fs.CreateTextFile("c:\GL1025\& ABB.NAME &".txt", True)
Set a = fs.CreateTextFile("c:\GL1025\" & ABB.NAME & ".txt", True)


try specifing the text propery:
Set a = fs.CreateTextFile("c:\GL1025\& ABB.NAME.TEXT &".txt", True)



--
HTHs Martin


"diacci1st" wrote:

HI
On the below code I would like to add a variable that uses the value of a
text box from a form:
So the form is AABB the text box is NAME

I have tried to change the code below to
Set a = fs.CreateTextFile("c:\GL1025\& ABB.NAME &".txt", True) but it does
not work
coul you please help?

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\GL1025\testfile.txt", True)
For Each Cell In Range("A1:A65000")
s = Cell.Value
a.WriteLine (s)
Next
a.Close


End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Saving a txt file

I do not believe that there is.

You probably have to either manually insert them or delete the hidden ones.
--
HTHs Martin


"diacci1st" wrote:

HI
On the below code I would like to add a variable that uses the value of a
text box from a form:
So the form is AABB the text box is NAME

I have tried to change the code below to
Set a = fs.CreateTextFile("c:\GL1025\& ABB.NAME &".txt", True) but it does
not work
coul you please help?

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\GL1025\testfile.txt", True)
For Each Cell In Range("A1:A65000")
s = Cell.Value
a.WriteLine (s)
Next
a.Close


End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Saving a txt file

Hi ..

Some issus.

One place you write AABB and in the code you write ABB

("c:\GL1025\& ABB.NAME &".txt",

you should add one "

("c:\GL1025\" & ABB.NAME &".txt",



diacci1st skrev:

HI
On the below code I would like to add a variable that uses the value of a
text box from a form:
So the form is AABB the text box is NAME

I have tried to change the code below to
Set a = fs.CreateTextFile("c:\GL1025\& ABB.NAME &".txt", True) but it does
not work
coul you please help?

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\GL1025\testfile.txt", True)
For Each Cell In Range("A1:A65000")
s = Cell.Value
a.WriteLine (s)
Next
a.Close


End Sub


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
Saving Excel 2007 file in 2003 creates very large file Jon Pearce Excel Discussion (Misc queries) 2 July 16th 09 07:20 PM
Text file saving, setting file origin mauddib Excel Discussion (Misc queries) 0 May 25th 06 02:50 PM
Saving multi-tab excel file created from comma delimited text file Marcus Aurelius Excel Programming 2 December 19th 05 05:16 PM
How do I stop Excel 2000 from saving file history from file that . Cathy Excel Discussion (Misc queries) 0 March 29th 05 03:27 PM
saving an excel file as an ASCII text file without delimiters Sewellst Excel Programming 4 January 7th 05 01:41 PM


All times are GMT +1. The time now is 03:59 AM.

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"