Renaming files based off excel spreadsheet

glukemey

New Member
Joined
Mar 8, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I apologize as I'm a VBA novice here, but been using the code from the thread below to auto rename files in a specified folder. The content of the files and amount of files are changing as new projects arise, but all old file names follow the same format. The new names do change based off the new project as well. It worked a few times after running a recent update to Microsoft Office I receive the error below when running the code.

"Run-time error '53':

File not found"

Been looking through the code and cannot determine what exactly the issue is, but the debugger says it is this line: Name myPath & "\" & oldName As myPath & "\" & newName

Does anyone know what my issue is?



1615219310203.png
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I'm using this same code.
When it hits newName in the Do loop, I'm getting Run-time error '9': Subscript out of range

It's my first time using VBA. Hoping to find help here, also.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top