Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default Copy file while in use

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy file while in use

workbooks("Test.xls").SavecopyAS "C:\Bye\Test.xls"

--
Regards,
Tom Ogilvy

"Todd Huttenstine" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Copy file while in use

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 *


"Todd Huttenstine" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default Copy file while in use

Thanks guys.


Todd
-----Original Message-----
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
.

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
copy data for match word from one file to another file mishak Excel Worksheet Functions 1 December 2nd 09 02:11 AM
How do I copy a excel file into a InDesign file correctly? cfb Excel Discussion (Misc queries) 2 June 14th 07 10:08 PM
copy the same raws of all sheets from about a 100 file to a new sheet of a book and save the file [email protected] Setting up and Configuration of Excel 0 March 14th 07 02:13 AM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
copy excell file to a CSV file and than to Notepad need to know bob Excel Discussion (Misc queries) 0 August 23rd 05 07:27 PM


All times are GMT +1. The time now is 10:23 AM.

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

About Us

"It's about Microsoft Excel"