Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rename .txt file with macro


Sorry about this rather simple question everyone but I have only jus
stated working with Excel!!

I need to rename an existing .txt file to a .xml file. The file wil
always be in the same directory on the pc, is this possible with cod
in a macro?

--
markjhunte
-----------------------------------------------------------------------
markjhunter's Profile: http://www.excelforum.com/member.php...fo&userid=1598
View this thread: http://www.excelforum.com/showthread.php?threadid=27456

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Rename .txt file with macro

IF you want something simple try the shell command and then "rename
c:\filename.txt c:\filename.xml"


"markjhunter" wrote in message
...

Sorry about this rather simple question everyone but I have only just
stated working with Excel!!

I need to rename an existing .txt file to a .xml file. The file will
always be in the same directory on the pc, is this possible with code
in a macro??


--
markjhunter
------------------------------------------------------------------------
markjhunter's Profile:
http://www.excelforum.com/member.php...o&userid=15988
View this thread: http://www.excelforum.com/showthread...hreadid=274563



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rename .txt file with macro


The following code allows you to change a filename, make sure and adjus
the
directory location / filename before running.

OldName = "C:\test.txt": NewName = "C:\test.xml"
Name OldName As NewNam

--
crispb
-----------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...fo&userid=1088
View this thread: http://www.excelforum.com/showthread.php?threadid=27456

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Rename .txt file with macro

Hi Markjhunter,

I need to rename an existing .txt file to a .xml file. The file will
always be in the same directory on the pc, is this possible with code
in a macro??


Sure, it's the Name command:

Name OldFile, NewFile

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


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
Rename Worksheet Tab as File Name Using a Macro Cue Excel Discussion (Misc queries) 10 December 24th 09 06:38 PM
FILE AUTO-RENAME Nimish Excel Discussion (Misc queries) 1 December 7th 06 09:10 PM
How to set SAVE AS file name to equal A1 contents when rename file E Excel Discussion (Misc queries) 0 October 19th 05 08:36 PM
Rename file Always Learning Excel Programming 4 July 15th 04 04:05 PM
rename file macro dtroupe Excel Programming 1 December 5th 03 12:50 AM


All times are GMT +1. The time now is 12:30 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"