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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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,215,009
Messages
6,122,674
Members
449,091
Latest member
peppernaut

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