ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Used to be possible in Excel97 (https://www.excelbanter.com/excel-programming/378510-used-possible-excel97.html)

Albert

Used to be possible in Excel97
 
Hi.
Is there any way of renaming files through VBA with Excel XP?
I remember it used to be possible with previous versions.
Best regards,
Albert C

NickHK

Used to be possible in Excel97
 
Albert,
Name "OldFile" As "NewFile"

NickHK

"Albert" wrote in message
...
Hi.
Is there any way of renaming files through VBA with Excel XP?
I remember it used to be possible with previous versions.
Best regards,
Albert C




Albert

Used to be possible in Excel97
 
I don't get it.

"NickHK" wrote:

Albert,
Name "OldFile" As "NewFile"

NickHK

"Albert" wrote in message
...
Hi.
Is there any way of renaming files through VBA with Excel XP?
I remember it used to be possible with previous versions.
Best regards,
Albert C





Jon Peltier

Used to be possible in Excel97
 
The command looks like this:

Name strOldFilename As strNewFilename

where strOldFilename and strNewFilename are string variables containing the
old and new filenames. Or just use the text:

Name "c:\temp\oldname.xls" As "c:\temp\newname.xls"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Albert" wrote in message
...
I don't get it.

"NickHK" wrote:

Albert,
Name "OldFile" As "NewFile"

NickHK

"Albert" wrote in message
...
Hi.
Is there any way of renaming files through VBA with Excel XP?
I remember it used to be possible with previous versions.
Best regards,
Albert C







NickHK

Used to be possible in Excel97
 
That's the code to use . Check the help for the Name statement.
Name "C:\Oldfile.txt" As "C:\NewFile.txt"

NickHK

"Albert" wrote in message
...
I don't get it.

"NickHK" wrote:

Albert,
Name "OldFile" As "NewFile"

NickHK

"Albert" wrote in message
...
Hi.
Is there any way of renaming files through VBA with Excel XP?
I remember it used to be possible with previous versions.
Best regards,
Albert C







Albert

Used to be possible in Excel97
 
Got it, did it.
Thanks.

"Jon Peltier" wrote:

The command looks like this:

Name strOldFilename As strNewFilename

where strOldFilename and strNewFilename are string variables containing the
old and new filenames. Or just use the text:

Name "c:\temp\oldname.xls" As "c:\temp\newname.xls"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Albert" wrote in message
...
I don't get it.

"NickHK" wrote:

Albert,
Name "OldFile" As "NewFile"

NickHK

"Albert" wrote in message
...
Hi.
Is there any way of renaming files through VBA with Excel XP?
I remember it used to be possible with previous versions.
Best regards,
Albert C








All times are GMT +1. The time now is 06:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com