Recognizing the Active Directory

keith0528

Active Member
Joined
Apr 23, 2009
Messages
250
Greetings,

I have an excel file that is copied into directory Y from directory X. When I run this code


sFile = ActiveWorkbook.Path & "\" & sFile

It still references directory X. How can i get it to recognize that it now resides in directory Y?


thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
You need to use the FileCopy method. For moving between directories, the full name (includes path) needs to be used for source and destination;
Eample:
Code:
FileCopy("C:\Temp\Data.xlsx", "C:\xlFiles\Data.xlsx")
Kill "C:\Temp\Data.xlsx"
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

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