Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
finao
 
Posts: n/a
Default Convert multiple XLS files to TXT

I need to convert hundreds of XLS files to TXT. I am aware of File/Save-as
and I also tried written a macro. Neither solution is workable even the
number of files I have to convert. Does Excel have a mass convert utility?
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

One possibility is to loop through all the files and convert the extension
from .xls to .txt. Try:

Sub ChangeXLStoTXT()
'Based on some old code from me
'with modifications from Dave Peterson
Dim MyFolder As String
Dim NewName As String
Dim i As Long
MyFolder = "C:\Program Files\ztest" '<----Change
Application.ScreenUpdating = False
With Application.FileSearch
.NewSearch
.LookIn = MyFolder
.SearchSubFolders = False
.Filename = "*.xls"
.FileType = msoFileTypeAllFiles
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
NewName = Left(.FoundFiles(i), _
Len(.FoundFiles(i)) - 4) & ".txt"
Set Wkbk = Workbooks.Open(Filename:=.FoundFiles(i))
With Wkbk
Application.DisplayAlerts = False
.SaveAs Filename:=NewName
Application.DisplayAlerts = True
.Close savechanges:=False
End With
Next
Else
MsgBox "There were no files found."
Exit Sub
End If
End With
Application.ScreenUpdating = True
End Sub

---
HTH
Jason
Atlanta, GA

"finao" wrote:

I need to convert hundreds of XLS files to TXT. I am aware of File/Save-as
and I also tried written a macro. Neither solution is workable even the
number of files I have to convert. Does Excel have a mass convert utility?

  #3   Report Post  
Jim Rech
 
Posts: n/a
Default

The last file conversion utility Excel included was in Excel 97, as far as I
know:

http://support.microsoft.com/default...b;en-us;161325

I don't know what formats it offered. If you cannot get this you might
revisit your macro as a macro can do this sort of thing quite easily.

--
Jim
"finao" wrote in message
...
|I need to convert hundreds of XLS files to TXT. I am aware of File/Save-as
| and I also tried written a macro. Neither solution is workable even the
| number of files I have to convert. Does Excel have a mass convert
utility?


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
Must convert 500+ xls files to txt (tsv) KKramsch Excel Discussion (Misc queries) 1 January 5th 05 05:53 PM
multiple text files URGENT tasha Excel Discussion (Misc queries) 1 December 19th 04 05:44 PM
importing multiple text files URGENT!!! HELP tasha Excel Worksheet Functions 0 December 19th 04 04:26 PM
importing multiple text files??? tashayu Excel Discussion (Misc queries) 0 December 19th 04 02:43 PM
Why do my links break when I burn multiple Excel files to a CD? akrr-rasmussen Excel Worksheet Functions 1 November 17th 04 02:39 AM


All times are GMT +1. The time now is 08:11 PM.

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"