ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FileCopy Question (https://www.excelbanter.com/excel-programming/393911-filecopy-question.html)

Bythsx-Addagio[_2_]

FileCopy Question
 
All the documentation I have read shows the following code.

FileCopy OriginalFile, CopiedFile

Why then is the following code return "Wrong number of arguments or invalid
property assignment" ?

Sub Test_Copy()

FileCopy "I:\out\BMSEP.pdf", "C:\FC_0706\BMSEP.pdf"

End Sub

Thanks for your help.

joel

FileCopy Question
 
Are you sure it is failing with the code you are showing. I got the code
below to work. I copied the code straight from the website just modifying the
file names. Try running thecode from files on your c: drive. then
changingg to the I: drive. therre may be diffferent permissions on the I:
drive or the C: subdirectory that is causing the error.

Try two directories that you have full permission to read and writte such as
mydocuments.


Sub Test_Copy()

FileCopy "c:\temp\1391.pdf", "c:\temp\newpdf.pdf"

End Sub


"Bythsx-Addagio" wrote:

All the documentation I have read shows the following code.

FileCopy OriginalFile, CopiedFile

Why then is the following code return "Wrong number of arguments or invalid
property assignment" ?

Sub Test_Copy()

FileCopy "I:\out\BMSEP.pdf", "C:\FC_0706\BMSEP.pdf"

End Sub

Thanks for your help.



All times are GMT +1. The time now is 07:34 PM.

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