Copy file while in use

T

Todd Huttenstine

Hey guys

How do you programmatically copy a file while its in use?

Lets say the file is "Test.xls". Test.xls is located in
C:\Hey directory. This is the open file. I want to copy
it from C:\Hey to C:\Bye.


How would I do this?

Thanks
Todd Huttenstine
 
R

Rob Bovey

Hi Todd,

If this file is in use because it is open in the same instance of Excel
that your code is running in you can use the Application.SaveCopyAs method
to save a copy to a different location. If the file is in use by some other
instance of Excel you're out of luck. You just have to wait until it's no
longer being used.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top