UPDATE:
The macro seems to fail when there is a large number of files to rename (more than ~50)
Hello,
I have a user form that adds prefixes to file names and also has the option to subtract text from file names. This is a userform that I downloaded from a excel vba forum, and adapted to add the subtract text functionality. The userform works fine on my computer and one other computer, but the prefix function does something strange on the 3rd computer I tested this on:
The prefix that is input repeatedly is added to the beginning of the file name. So, if I wanted to add JPM_ as a prefix, the file name would return something like JPM_JPM_JPM_JPM_JPM_JPM_JPM_JPM_JPM_file.jpg (it eventually gives an error and stops- not before adding the long prefix to the file)
Below is the code, and attached is the workbook with userform.
I believe what is happening is the Loop based off of tmpDIR under the "rename_files" sub is not ending and is for some reason repeating until it breaks. I was capable of adapting the code to my needs, but am not really capable of re-writing what I have , and so this problem has me stymied. Can anyone help me fix this?
test.xlsm![]()
Please Login or Register to view this content.
Note that all three computers are running the same version of excel (2013)
Bookmarks