Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Moving Files

Hi everybody

I have a workbook that contains a procedure which:

1, Opens a .xls from a SourceDir
2, Alters the contents of this .xls
3, Produces and saves a CSV file to a CSVTargetDir
4, Saves and closes the altered .xls to AnotherTargetDir

Is it possible to move the original .xls file from the SourceDir
to an ArchiveDir ?

Many thanks
PS using Excel 2002

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Moving Files

Pete,
Check out FileCopy and Kill.

NickHK

"PraxisPete" wrote in message
...
Hi everybody

I have a workbook that contains a procedure which:

1, Opens a .xls from a SourceDir
2, Alters the contents of this .xls
3, Produces and saves a CSV file to a CSVTargetDir
4, Saves and closes the altered .xls to AnotherTargetDir

Is it possible to move the original .xls file from the SourceDir
to an ArchiveDir ?

Many thanks
PS using Excel 2002



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Moving Files

PraxisPete:
Is it possible to move the original .xls file from the SourceDir
to an ArchiveDir ?


try,

Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile ThisWorkbook.FullName, "c:\" & ThisWorkbook.Name

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"PraxisPete" wrote:

Hi everybody

I have a workbook that contains a procedure which:

1, Opens a .xls from a SourceDir
2, Alters the contents of this .xls
3, Produces and saves a CSV file to a CSVTargetDir
4, Saves and closes the altered .xls to AnotherTargetDir

Is it possible to move the original .xls file from the SourceDir
to an ArchiveDir ?

Many thanks
PS using Excel 2002

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Moving Files

Dim OldName, NewName
OldName = "OLDFILE": NewName = "NEWFILE" ' Define file names.
Name OldName As NewName ' Rename file.

OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName ' Move and rename file.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"PraxisPete" wrote in message
...
Hi everybody

I have a workbook that contains a procedure which:

1, Opens a .xls from a SourceDir
2, Alters the contents of this .xls
3, Produces and saves a CSV file to a CSVTargetDir
4, Saves and closes the altered .xls to AnotherTargetDir

Is it possible to move the original .xls file from the SourceDir
to an ArchiveDir ?

Many thanks
PS using Excel 2002



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
Moving Files into an archive Sher Excel Discussion (Misc queries) 2 October 3rd 07 01:06 PM
Moving files which are linked chrismc1972 Excel Discussion (Misc queries) 1 January 23rd 07 09:28 PM
Moving xls files that have links?? Bill Links and Linking in Excel 2 November 2nd 06 06:57 AM
Moving files via code Conan Kelly Excel Programming 1 November 21st 05 10:17 PM
Moving Files in Excel D Huber Excel Discussion (Misc queries) 1 June 24th 05 08:00 PM


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