Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default File Copy Error

I have copied this file from office excel help and ran it with error message
as follows. Run time error: '53' File Not Found
My deault folder address is My Documents and SRCFILE is under this directory.
Thank you for your advices .

Sub FileCopyTest()
Dim SourceFile, DestinationFile
SourceFile = "SRCFILE" ' Define source file name.
DestinationFile = "DESTFILE" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default File Copy Error

Try adding the file extensions:

Sub Cpy()
Dim SourceFile As String
Dim DestinationFile As String
SourceFile = "SRCFILE.xls" ' Define source file name.
DestinationFile = "DESTFILE.xls" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.
End Sub

Hope this helps
Rowan

Jay wrote:
I have copied this file from office excel help and ran it with error message
as follows. Run time error: '53' File Not Found
My deault folder address is My Documents and SRCFILE is under this directory.
Thank you for your advices .

Sub FileCopyTest()
Dim SourceFile, DestinationFile
SourceFile = "SRCFILE" ' Define source file name.
DestinationFile = "DESTFILE" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Error opening edited XML file - Where is the error log? JonBoy Excel Discussion (Misc queries) 0 March 10th 09 09:40 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
"Path/File Access Error" on Sheets.Copy Nick Cranham Excel Programming 4 April 15th 04 01:41 PM


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"