rename workbook?

  • Thread starter Thread starter Claude
  • Start date Start date
Hi Claude
as far as I know you need to save it under a different name (as the
workbook name is the filename). Also the name property of the workbook
object is read-only
 
If you want to rename a existing file without opening it
you can use this

From the VBA help
**************************

Name Statement Example
This example uses the Name statement to rename a file. For purposes of this
example, assume that the directories or folders that are specified already
exist. On the Macintosh, "HD:" is the default drive name and portions of the
pathname are separated by colons instead of backslashes.

Dim OldName, NewName
OldName = "OLDFILE": NewName = "NEWFILE" ' Define file names.
Name OldName As NewName ' Rename file.

OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName ' Move and rename file.
 
Hi,

One way would be to save the workbook under it's new name and then
delete(kill) the original..

Regards,
Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top