ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Export an excel file as text without change of document type (https://www.excelbanter.com/excel-programming/321317-export-excel-file-text-without-change-document-type.html)

Michael[_36_]

Export an excel file as text without change of document type
 
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

Tom Ogilvy

Export an excel file as text without change of document type
 
ActiveSheet.copy
ActiveWorkbook.SaveAs "C:\MyFolder\MyFile.txt", xlCSV
Activeworkbook.Close SaveChanges:=False

Change xlCSV to the type of text file you want.
--
Regards,
Tom Ogilvy

"Michael" wrote in message
om...
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





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

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