where did the files move to?

babyrabbit

New Member
Joined
Jun 3, 2016
Messages
2
I recently made an error, and have found it repeatable in several formats. It happens when renaming file(s) using Excel's hidden method "Name", or Scripting.FileSystemObject's MoveFile, to name a few.

When you rename and specify only a destination filename without path, the file(s) simply disappear, without a trace. I've searched the C-drive for both the new and old filenames and the files do not exist as either, anywhere. I can't imagine a rename function would delete them.

The old DOS' MOVE command allowed renaming by specifying the destination as newname-without-path. That's how I found this - by forgetting to add the path while half-remembering that it worked under DOS.

Has anyone on this forum ever heard of this? I'm mostly curious where they go. Please no bit bucket jokes.
 

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.
Welcome to the board.

With

Code:
Name "C:\Users\shg\Documents\Docs - shg\Office\Scratch\test\Bob.xlsx" As "Joe.xlsx"

... the file moved to MyDocuments.
 
Upvote 0

Forum statistics

Threads
1,214,986
Messages
6,122,611
Members
449,090
Latest member
vivek chauhan

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