View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jason Morin[_3_] Jason Morin[_3_] is offline
external usenet poster
 
Posts: 18
Default Change .txt file to .xls

I've been fighting this for a while. I'm trying to
convert a group of small text files (avg. 600 lines each)
in a folder to .xls files. All my attempts have failed.
Can someone lead me in the right direction on how to
convert at least one?

Sub ChangeExt()
Dim mytextfile As Object
Set mytextfile = GetObject("C:\Documents and
Settings\myfile.txt")
mytextfile.SaveAs "C:\Documents and Settings\myfile.xls"
End Sub

Thanks for any guidance you can provide.
Jason