ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   API code for 'Renaming a Directory' (https://www.excelbanter.com/excel-programming/429123-api-code-renaming-directory.html)

Joakim Norrman[_2_]

API code for 'Renaming a Directory'
 
I have not found a command in VBA to rename a directory in Windows Explorer.
Does anyone know the API code for renaming a directory?

Jacob Skaria

API code for 'Renaming a Directory'
 
Using File System Object...

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\temp1" , "C:\temp2"

If this post helps click Yes
---------------
Jacob Skaria


"Joakim Norrman" wrote:

I have not found a command in VBA to rename a directory in Windows Explorer.
Does anyone know the API code for renaming a directory?


Peter T

API code for 'Renaming a Directory'
 
See the Name function in VBA help

Name sOldPath As sNewPath

Regards,
Peter T

"Joakim Norrman" wrote in message
...
I have not found a command in VBA to rename a directory in Windows
Explorer.
Does anyone know the API code for renaming a directory?





All times are GMT +1. The time now is 12:34 PM.

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