ajRenameFile function
Description
The ajRenameFile function renames the specific file.
Syntax
ajRenameFile(file_path, new_name, [run_condition],[run_by_function_point_only])
Argument Name | Description |
---|---|
file_path (required) | Specify the full path of the file to be renamed. Both the forward-slash (/) and backslash (\) are supported as the folder separator. |
new_name (required) | Specify the new name of the file. |
run_condition (optional) | The function will run when the value is TRUE. Otherwise will not run. If you do not specify anything, the default value will always be TRUE. |
run_by_function_point_only (optional) | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Run Function Point. If it equals TRUE, the function can be executed with Run Function Point (AlchemyJ toolbar \ Run Function Point) only. If you do not specify anything, the default value will always be TRUE. |
The function will return:
1) Content type: TRUE, #VALUE!
2) Method: Within a cell / cell array
Example
=ajRenameFile("c:\original.txt", "new.txt")
If the file and folder path exist, 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.