Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Copy File without opening

Excel Experts,

Without opening the file, I want to copy a text file in one directory to
another directory and save it with a different name.

Specifically, I have a file C:\ACDocs\First\pa.txt"
and without opening, I want to save it as C:\ACDocs\Second\portfolio.txt"

I tried the below code but I an "Object Required" errror on the SaveCopyAs
line.

Sub Macro1()

FN1 = "C:\ACDocs\First\pa.txt"

FN1.SaveCopyAs "C:\ACDocs\Second\portfolio.txt"

End Sub

What code would work?

Thanks in advance,
Alan


--
achidsey
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy File without opening

Sub Macro1()

FN1 = "C:\ACDocs\First\pa.txt"

FileCopy FN1, "C:\ACDocs\Second\portfolio.txt"

End Sub

--
Regards,
Tom Ogilvy


"achidsey" (notmorespam) wrote in message
...
Excel Experts,

Without opening the file, I want to copy a text file in one directory to
another directory and save it with a different name.

Specifically, I have a file C:\ACDocs\First\pa.txt"
and without opening, I want to save it as C:\ACDocs\Second\portfolio.txt"

I tried the below code but I an "Object Required" errror on the SaveCopyAs
line.

Sub Macro1()

FN1 = "C:\ACDocs\First\pa.txt"

FN1.SaveCopyAs "C:\ACDocs\Second\portfolio.txt"

End Sub

What code would work?

Thanks in advance,
Alan


--
achidsey



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Copy File without opening

Tom,

Thanks as always.

Alan

--
achidsey


"Tom Ogilvy" wrote:

Sub Macro1()

FN1 = "C:\ACDocs\First\pa.txt"

FileCopy FN1, "C:\ACDocs\Second\portfolio.txt"

End Sub

--
Regards,
Tom Ogilvy


"achidsey" (notmorespam) wrote in message
...
Excel Experts,

Without opening the file, I want to copy a text file in one directory to
another directory and save it with a different name.

Specifically, I have a file C:\ACDocs\First\pa.txt"
and without opening, I want to save it as C:\ACDocs\Second\portfolio.txt"

I tried the below code but I an "Object Required" errror on the SaveCopyAs
line.

Sub Macro1()

FN1 = "C:\ACDocs\First\pa.txt"

FN1.SaveCopyAs "C:\ACDocs\Second\portfolio.txt"

End Sub

What code would work?

Thanks in advance,
Alan


--
achidsey




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 opening new copy of application for each file Michelle Excel Discussion (Misc queries) 2 July 31st 09 08:02 AM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
Copy File Automatically on Opening It Dolores Excel Discussion (Misc queries) 4 December 30th 05 07:12 PM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
Copy a Sheet without physically opening the file Michael Kintner Excel Programming 1 January 5th 04 08:21 PM


All times are GMT +1. The time now is 10:57 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"