01-25-2023 02:57 AM
Dear all,
I'm trying to copy and paste a file to a folder with the same name. My idea is, I tried to make a comparison between the file name and the folder name and if the same it will be copied to the folder according to the name. I tried to make code for this idea but it didn't work.
I'm attaching pictures and files for your reference :
Copy file
Paste into this folder by name
01-25-2023 03:06 AM
Hi Nur,
@SofeaNur wrote:
I'm trying to copy and paste a file to a folder with the same name. My idea is, I tried to make a comparison between the file name and the folder name and if the same it will be copied to the folder according to the name. I tried to make code for this idea but it didn't work.
You need to provide a full filepath also for the destination of your copy operation! (It does not allow to copy a file as a folder…)
Use BuildPath also for the destination as yoou do for the source of the FileCopy function.