Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Convert Multiple CSV Files to XLS Files (Again)

Hi Everyone,

I am still trying to convert a folder full of CSV files to XLS files. In an
earlier post I was given a macro, as shown he



Sub TransformCSVToXls()
Application.DisplayAlerts = False
myFile = ActiveWorkbook.Name
myPath = "C:\Documents and Settings\DEITBE\My Documents\Excel\Delete These\"
WorkFile = Dir(myPath & "*.CSV")

Do While WorkFile < ""
Application.StatusBar = "Now working on " & WorkFile
Workbooks.Open FileName:=myPath & WorkFile
MsgBox ActiveWorkbook.Name
ActiveWorkbook.SaveAs FileName:=myPath & _
Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4),
FileFormat:=xlNormal
ActiveWorkbook.Close
Windows(myFile).Activate
WorkFile = Dir()
Loop

Application.StatusBar = False

End Sub




I would really appreciate if someone could a) tell me if this macro actually
will work, and b) edit it so that I can use it in my situation.

I have a few requirements, being:

* The folder containing the CSV files will be called GMS, and will be a
subfolder of the macro i.e. C:\MACRO_IN_HERE\GMS\
* I do not want any message boxes or windows to pop up. I simply want the
macro to open 20 or so csv files and change them all to XLS files.

Thanks!
Dave
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Convert Multiple CSV Files to XLS Files (Again)

Hi Dave

You can use this two macros

First this one (see CSV macro)
http://www.rondebruin.nl/txtcsv.htm

Then you can use this macro to create a new workbook from every sheet
http://www.rondebruin.nl/copy6.htm

You can do it in one macro also but I have no time now to make one .



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave" wrote in message ...
Hi Everyone,

I am still trying to convert a folder full of CSV files to XLS files. In an
earlier post I was given a macro, as shown he



Sub TransformCSVToXls()
Application.DisplayAlerts = False
myFile = ActiveWorkbook.Name
myPath = "C:\Documents and Settings\DEITBE\My Documents\Excel\Delete These\"
WorkFile = Dir(myPath & "*.CSV")

Do While WorkFile < ""
Application.StatusBar = "Now working on " & WorkFile
Workbooks.Open FileName:=myPath & WorkFile
MsgBox ActiveWorkbook.Name
ActiveWorkbook.SaveAs FileName:=myPath & _
Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4),
FileFormat:=xlNormal
ActiveWorkbook.Close
Windows(myFile).Activate
WorkFile = Dir()
Loop

Application.StatusBar = False

End Sub




I would really appreciate if someone could a) tell me if this macro actually
will work, and b) edit it so that I can use it in my situation.

I have a few requirements, being:

* The folder containing the CSV files will be called GMS, and will be a
subfolder of the macro i.e. C:\MACRO_IN_HERE\GMS\
* I do not want any message boxes or windows to pop up. I simply want the
macro to open 20 or so csv files and change them all to XLS files.

Thanks!
Dave

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
converter tool to convert XL 2007 files to XL 2003 files Dave F Excel Discussion (Misc queries) 6 December 15th 06 12:45 AM
Can I convert my Quatro Pro files to MS Excel files? James HW New Users to Excel 3 May 11th 06 04:42 PM
how to convert multiple XLS files to CSV? Mr.P. Excel Discussion (Misc queries) 3 March 27th 06 02:20 PM
How can I view files chronologically when opening multiple files Stevilsize Excel Discussion (Misc queries) 3 July 26th 05 12:49 AM
Convert multiple XLS files to TXT finao Excel Discussion (Misc queries) 2 June 8th 05 03:14 PM


All times are GMT +1. The time now is 05:40 AM.

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"