Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I rename a directory using a macro

Hi,

Is the a way to rename the directory the open excel file is in, using a macro?
ex: C:\test\test.xls to C:\new\test.xls using a macro in test.xls

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Can I rename a directory using a macro

Hi Harvey,

You can use the builtin Name function

name "C:\MyTest\Volker.xls" aS "c:\MYtEST\Volker1.xls"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Harvey" wrote in message
...
Hi,

Is the a way to rename the directory the open excel file is in, using a

macro?
ex: C:\test\test.xls to C:\new\test.xls using a macro

in test.xls

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can I rename a directory using a macro

Harvey,

Assuming that the destination folder exists, use

Name "C:\Test\Test.xls" As "C:\New\Test.xls"

If the folder does not exist, use MkDir to create the folder
first:

MkDir "C:\New"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Harvey" wrote in message
...
Hi,

Is the a way to rename the directory the open excel file is in,

using a macro?
ex: C:\test\test.xls to C:\new\test.xls

using a macro in test.xls

Thanks



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 of sheets by macro Harshad[_2_] Excel Discussion (Misc queries) 4 October 17th 08 01:09 PM
Can you copy a Excel file to a new directory and rename it? pokdbz Excel Discussion (Misc queries) 1 August 1st 07 08:44 PM
Rename Macro rmpete Excel Discussion (Misc queries) 3 February 11th 06 10:24 PM
rename file macro dtroupe Excel Programming 1 December 5th 03 12:50 AM
MACRO TO RENAME SHEET ! Jay Dean Excel Programming 1 October 17th 03 08:58 AM


All times are GMT +1. The time now is 02:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"