ajRenameFolder function
Available since AlchemyJ v4.1.3
Description
The ajRenameFolder function renames the specific folder.
Syntax
ajRenameFolder(folder_path, new_name, [run_condition],[run_by_function_point_only])
Argument Name | Argument Type | Description |
---|---|---|
folder_path (required) | String | The path of the folder to be renamed. Both the forward-slash (/) and backslash (\) are supported as the folder separator. |
new_name (required) | String | The new name of the folder. |
run_condition (optional) | Boolean | The function will run when the value is TRUE. Otherwise will not run. The default value is TRUE. |
run_by_function_point_only (optional) | Boolean | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Preview Function Point. If it equals TRUE, the function can be executed with Preview Function Point (AlchemyJ ribbon \ Preview Function Point) only. The default value is TRUE. |
The function will return:
1) Return Value: TRUE, #VALUE!
2) Return Type: Single Value
Example
=ajRenamefolder("c:\original", "new")
If the folder path exists, and the file is renamed successfully, the function returns TRUE. If the file does not exist, or there is a file with the same name already, or any other error occurs, error #VALUE! would be returned.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type. Besides, system will raise error for below scenario(s).
Invalid file path. |
---|
Folder path does not exist. |
Invalid new name. |
New name already exists in the folder path. |