View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Renaming multiple files from *.csv to *.txt


further to my earlier post:, some notes on OpenText see:

http://www.oaltd.co.uk/ExcelProgRef/...rogRefCh22.htm


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Richard Fuller wrote :

Unlike Excel 2000, which I used until the recent demise of my "old"
computer, Excel 2003 (WinXP) scrambles dates in *.csv files opened
with a VBA macro. The simple cure is to rename the *.csv files to
*.text before opening them with the Workbooks.OpenText method and
stipulate how the date string should be handled.

This is easy enough with only one file, but how can it be incorporated
with the GetOpenFilename(MultiSelect:=True)method? What I'd like to do
is have each selected file renamed to *.txt within the loop before it
is opened. I'd be forever grateful for some sample code to point me in
the right direction.

Here's the code I've been using for some years (called by the main
routine):