DouglasWicker
New Member
- Joined
- Aug 8, 2017
- Messages
- 38
Afternoon All,
I am trying to copy a file from one location to another. Just use FileCopy right?
Well urmm no? The issue I have is that the file that is copied changes and therefore its name address and extension can change. Its full address is saved as a variable. I am trying to paste it in a folder without changing the name of the file and am strugging. Hopefully this code below will help explain what I require.
This works. However it requires me to manually change the name of the file when pasted into the destination folder, therefore is no good. Both the source address is a variable as is the destination folder address.
What I need then is this, however it is not working, I get a 75 error, path/ file access error.
Anyone got any ideas?
I am trying to copy a file from one location to another. Just use FileCopy right?
Well urmm no? The issue I have is that the file that is copied changes and therefore its name address and extension can change. Its full address is saved as a variable. I am trying to paste it in a folder without changing the name of the file and am strugging. Hopefully this code below will help explain what I require.
This works. However it requires me to manually change the name of the file when pasted into the destination folder, therefore is no good. Both the source address is a variable as is the destination folder address.
Code:
FileCopy "C:\Test\Test.xlsm", "C:\iamtestinghere\Test.xlsm"
What I need then is this, however it is not working, I get a 75 error, path/ file access error.
Code:
FileCopy "C:\Test\Test.xlsm", "C:\iamtestinghere\"
Anyone got any ideas?