Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 70, Permission denied 1

Status
Not open for further replies.

tatochka

Programmer
May 3, 2001
49
0
0
US
I get this message when coping or moving file. I tried different kind of files and different directories. Still the same message. Can somebody help? Here is the code:

***********************
Dim fso As New FileSystemObject, file1, file2, fldr As Folder

Set file1 = fso.GetFile("c:\tanya.cbx")
file1.Copy ("c:\temp\TestMove\ml")
***************

tanya.cbx is just an empty test file that I created.
 
Probably the problem is that you need to use the filename in the Copy method like this:
file1.Copy ("c:\temp\TestMove\ml\tanya.cbx")


But in case you wanted to name the file "ml" and that was not just a folder name, then here are some things that come to mind for this kind of problem:
* Do you have permissions to source file and the destination directory?
* Is the file perhaps locked by some application?
* What context is your program running under? Your login? Local system?
 
Yep, that was it. I added the file name and it works. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top