How do i save as a textfile in a macro?

A

Alex_DK

Hi
I have problems saving my text file in the right format?
I am working on a macro that opens a text file, changes a value to a value
found in another workbook, and saving the changed textfile with a new name.
The lines in the text files contains both text and numbers, and are seperated
by commas. The text file is opened with no delimiters and some of the lines
are changed.

The changing and renaming part works fine, but excel adds a " at each end of
every line in the new text file when the macro saves the file. This doesn't
happen when I save the file manually... Does anyone know how to avoid getting
the " when the macro saves the file?

Greetings
Alex
 
E

Ed

What process are you using to open, write to, and save your text file? I
think I was using FreeFile and Write and it threw in quotes all over the
place. That's just the way that works. If that's what you're doing, check
out Write # in the VBA Help.

Ed
 
S

Serge

Alex,

If you have found the solution, could yu tell me how you automatically save
your excel file as a textfile in a macro ?

Thanks in advance
Serge
 
D

Dave Peterson

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top