|
-
Jun 20th, 2009, 07:27 PM
#1
Thread Starter
Member
file copy problem
alright this is my last question of the day =O
anyway so im trying to do a file copy with this code
FileCopy FileName, "C:\Users\Asus Man\programing stuff"
Filename is the variable that carries the filename so thats working but i keep getting the error: "Path/file access error"
-
Jun 20th, 2009, 07:34 PM
#2
Re: file copy problem
If the target path does not exist, it needs to be created.
If the target file has read-only, hidden, and/or system attributes, error.
Be sure to include the new file name in the target path, even if the filename is not changing.
1. Ensure the target path exists. Can use Dir() to do this
2. Test the target file attributes with GetAttr() function
3. Change the target attr if needed: SetAttr(targetfilename, vbNormal)
4. Then try to copy
-
Jun 20th, 2009, 09:53 PM
#3
Thread Starter
Member
Re: file copy problem
im not linking it to a file...im copying it to a folder?
-
Jun 20th, 2009, 09:57 PM
#4
Re: file copy problem
All of what I posted still applies. When I mentioned target file, it applies if you are overwriting an existing file.
-
Jun 20th, 2009, 10:10 PM
#5
Thread Starter
Member
Re: file copy problem
ok when i do GetAttr i get 16?
-
Jun 20th, 2009, 11:52 PM
#6
Re: file copy problem
16 = vbDirectory. It's telling you the path is a directory. As I mentioned earlier, and probably the reason for the problem, "Be sure to include the new file name in the target path, even if the filename is not changing."
-
Jun 21st, 2009, 12:12 AM
#7
Thread Starter
Member
Re: file copy problem
 Originally Posted by LaVolpe
16 = vbDirectory. It's telling you the path is a directory. As I mentioned earlier, and probably the reason for the problem, "Be sure to include the new file name in the target path, even if the filename is not changing."
is there anyway to copy it with the same filename?
-
Jun 21st, 2009, 12:16 AM
#8
Thread Starter
Member
Re: file copy problem
 Originally Posted by hans4
is there anyway to copy it with the same filename?
or get the file name when u click it?
-
Jun 21st, 2009, 12:22 AM
#9
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|