Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel opening new copy of application for each file | Excel Discussion (Misc queries) | |||
File:1 and File:2 -- Double Files when Opening One File | Excel Discussion (Misc queries) | |||
Copy File Automatically on Opening It | Excel Discussion (Misc queries) | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) | |||
Copy a Sheet without physically opening the file | Excel Programming |