Hi Diane,
I've got a conversion of csv files running as well, an use
Code:
Application.Workbooks.Open Filename:=p_sFileArray(l_iFileCounter), Delimiter:=","
to open the files without having to convert to columns. Enter whatever delimiter is used - I've used the comma because of the csv file type, but we also receive pipe-delimited files and it works fine for that as well.
Perhaps that would remove the need of opening and converting text to columns (in case you're using the DATA > CONVERT TEXT TO COLUMNS option)
If you still need to convert your files, and you don't want to sit & watch Excel doing this, use the option
Code:
Application.ScreenUpdating = False
Application.DisplayAlerts = False
at the start of your routine, and switch both options back on when it's done:
Code:
Application.ScreenUpdating = True
Application.DisplayAlerts = True
The ScreenUpdating will stop Excel displaying what it does, the DisplayAlerts will suppress any Dialog boxes that might pop up (such as the "Do you want to save changes ..."dialog box). For all alerts Excel will assume it should take the default answer (in the case of "Do you want to .."the default answer's YES)
I also find it useful to use the statusbar to display progress: all you need to do is to use
Code:
Application.Statusbar = 'Processing file " & p_sFileArray(l_iFileCounter)
or
[code[ Application.StatusBar = "Processing file " & l_iFileCounter & " of " & Ubound(p_sFileArray) " files."[/code]
That way you can keep an eye on progress - the Statusbar´s the only object that WILL update when ScreenUpdating is set to FALSE
Now you will not be able to use this instance of Excel while it's running the macro (you CAN always break into the code ...) but you CAN open another instance and work as per usual, leaving your macro to run quietly in the background.
PLZ NOTE: If there´s an error or if you break into the macro execution manually, DO NOT forget to set the ScreenUpdating, DisplayAlerts & Statusbar options back to FALSE. If you forget - exit Excel ans reopen - this will reset these options automatically
HTH! If not, plz reply
Cheers,
Nikki