ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Runtime error Permission Denied (https://www.excelbanter.com/excel-programming/286441-runtime-error-permission-denied.html)

Todd Huttenstine[_2_]

Runtime error Permission Denied
 
Below is my code. It works on my computer but when I
tried it on another computer I get the error "Runtime
error 70. Permission Denied." and it highlights the last
code (FileCopy FileFrom, FileTo). The code is below.

Dim FileFrom As String
Dim FileTo As String

FileFrom = Worksheets(1).Range("G4").Value
FileTo = Worksheets(1).Range("G5").Value
FileCopy FileFrom, FileTo

The file paths are correct but it wont bperform the copy
to instruction. I tried to mannualy copy and paste and it
works, so why can it not programmatically do it?

Thank you

Todd Huttenstine

Todd Huttenstine[_2_]

Runtime error Permission Denied
 
Nevermind, I got it to work. I just restarted Excel and
it solved the problem.

Todd Huttenstine


-----Original Message-----
Below is my code. It works on my computer but when I
tried it on another computer I get the error "Runtime
error 70. Permission Denied." and it highlights the last
code (FileCopy FileFrom, FileTo). The code is below.

Dim FileFrom As String
Dim FileTo As String

FileFrom = Worksheets(1).Range("G4").Value
FileTo = Worksheets(1).Range("G5").Value
FileCopy FileFrom, FileTo

The file paths are correct but it wont bperform the copy
to instruction. I tried to mannualy copy and paste and

it
works, so why can it not programmatically do it?

Thank you

Todd Huttenstine
.



All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com