Export an excel file as text without change of document type

M

Michael

Hello,

I'm using excel to generate quite large text files. I want to save
automatically from a VB script the result of an excel sheet in a text
file. But using the "save as" function changes the document type of my
excel sheet.

Is there any option to just export the text file and leaving the Excel
sheet as it is?

Yours

Michael
 
T

Tom Ogilvy

ActiveSheet.copy
ActiveWorkbook.SaveAs "C:\MyFolder\MyFile.txt", xlCSV
Activeworkbook.Close SaveChanges:=False

Change xlCSV to the type of text file you want.
 

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