#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default FileCopy

Don,

You are right. You could use something like the following to preeventoverwriting an existng file:

If Dir("C:\Data.xls") = "" Then
FileCopy "C:\MyFiles\Data.xls", "C:\Data.xls"
Else
MsgBox "File already exists"
End If


--

John Green - Excel MVP
Sydney
Australia


"Donald Lloyd" wrote in message ...
Hi,

I'm looking at using the FileCopy function to copy a file(s) from one drive
to another.
Am I right in observing that this function will overwrite a File without
warning ?

Regards,
Don

--





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default FileCopy

Thank you John


very helpful.

Don

--

"John Green" wrote in message
...
Don,

You are right. You could use something like the following to

preeventoverwriting an existng file:

If Dir("C:\Data.xls") = "" Then
FileCopy "C:\MyFiles\Data.xls", "C:\Data.xls"
Else
MsgBox "File already exists"
End If


--

John Green - Excel MVP
Sydney
Australia


"Donald Lloyd" wrote in message

...
Hi,

I'm looking at using the FileCopy function to copy a file(s) from one

drive
to another.
Am I right in observing that this function will overwrite a File without
warning ?

Regards,
Don

--







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
filecopy Question rjvega Excel Discussion (Misc queries) 2 July 8th 08 09:12 PM
FileCopy error Chip Pearson Excel Programming 0 August 1st 03 02:43 PM


All times are GMT +1. The time now is 05:00 AM.

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"