Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Move a file without opening it.

Hi all,

Hope someone can help.

Is it possible to move a file from one sub-directory to another without
opening it.

The problem is that my program is relying on only opening '.xls' files of a
specific filename convention. Therefore, if someone has put a file in the
sub-directory that is not what I am looking for, I want to move it. At the
moment I just 'Kill' the erroneous file but that is not very friendly, on
the other hand, I don't want to 'Open' it, 'Save' it to a new location and
then 'Kill' it in it's original location.

Regards,


David Seebaran.

E-mail:


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Move a file without opening it.

David,

Assuming that both directories exist, you can use the Name statement to move
the file from one directory to the other. E.g,

Name "C:\Test\Test.txt" As "C:\Test2\Test.txt"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"David Seebaran" wrote in message
...
Hi all,

Hope someone can help.

Is it possible to move a file from one sub-directory to another without
opening it.

The problem is that my program is relying on only opening '.xls' files of

a
specific filename convention. Therefore, if someone has put a file in the
sub-directory that is not what I am looking for, I want to move it. At

the
moment I just 'Kill' the erroneous file but that is not very friendly, on
the other hand, I don't want to 'Open' it, 'Save' it to a new location and
then 'Kill' it in it's original location.

Regards,


David Seebaran.

E-mail:




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Move a file without opening it.

Hi Chip,

Thank you very much, it works perfectly.

Regards,


David Seebaran.

E-mail:

"Chip Pearson" wrote in message
...
David,

Assuming that both directories exist, you can use the Name statement to

move
the file from one directory to the other. E.g,

Name "C:\Test\Test.txt" As "C:\Test2\Test.txt"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"David Seebaran" wrote in message
...
Hi all,

Hope someone can help.

Is it possible to move a file from one sub-directory to another without
opening it.

The problem is that my program is relying on only opening '.xls' files

of
a
specific filename convention. Therefore, if someone has put a file in

the
sub-directory that is not what I am looking for, I want to move it. At

the
moment I just 'Kill' the erroneous file but that is not very friendly,

on
the other hand, I don't want to 'Open' it, 'Save' it to a new location

and
then 'Kill' it in it's original location.

Regards,


David Seebaran.

E-mail:






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
opening a file in Excel starts application but dose not open file Bob Shelton Excel Discussion (Misc queries) 1 July 2nd 08 07:51 PM
On opening a worksheet move focus to a cell based on date davcas Excel Worksheet Functions 1 July 1st 08 02:18 PM
Opening file in Excel 2003 opens multipule instances of same file Ed_B Excel Discussion (Misc queries) 1 June 21st 07 07:10 PM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM


All times are GMT +1. The time now is 04:15 PM.

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"