Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JHB JHB is offline
external usenet poster
 
Posts: 30
Default How do I delete an xls file using a .xl macro in a different file?

I have an application where I am importing data from an .xls
file,manipulating it and saving it in a different file. From the
second file I need to create a macro that will delete the original
file! I need to do this because there is a seperate application
creating the feeder file, and if I create more than opne file it gets
stored with the count after it as in:

Feeder.xls
Feeder(1).xls
Feeder(2).xls etc

I know exactly where the file will be (in what folder and drive), I
just dont have a clue as to how to write a macro to remove it. I am
using Excel 2000.

Thanks in advance

John Baker
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I delete an xls file using a .xl macro in a different file?

After you import the data, you can use Kill to delete the file.

Kill "x:\yourpathtothefile\feeder.xls"



JHB wrote:

I have an application where I am importing data from an .xls
file,manipulating it and saving it in a different file. From the
second file I need to create a macro that will delete the original
file! I need to do this because there is a seperate application
creating the feeder file, and if I create more than opne file it gets
stored with the count after it as in:

Feeder.xls
Feeder(1).xls
Feeder(2).xls etc

I know exactly where the file will be (in what folder and drive), I
just dont have a clue as to how to write a macro to remove it. I am
using Excel 2000.

Thanks in advance

John Baker


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default How do I delete an xls file using a .xl macro in a different file?

Hi John

Look at the "Kill" statement in help.

Regards,
Per


"JHB" skrev i meddelelsen
...
I have an application where I am importing data from an .xls
file,manipulating it and saving it in a different file. From the
second file I need to create a macro that will delete the original
file! I need to do this because there is a seperate application
creating the feeder file, and if I create more than opne file it gets
stored with the count after it as in:

Feeder.xls
Feeder(1).xls
Feeder(2).xls etc

I know exactly where the file will be (in what folder and drive), I
just dont have a clue as to how to write a macro to remove it. I am
using Excel 2000.

Thanks in advance

John Baker


  #4   Report Post  
Posted to microsoft.public.excel.misc
JHB JHB is offline
external usenet poster
 
Posts: 30
Default How do I delete an xls file using a .xl macro in a differentfile?

On Aug 2, 3:56*pm, Dave Peterson wrote:
After you import the data, you can use Kill to delete the file.

Kill "x:\yourpathtothefile\feeder.xls"



JHB wrote:

I have an application where I am importing data from an .xls
file,manipulating it and saving it in a different file. From the
second file I need to create a macro that will delete the original
file! I need to do this because there is a seperate application
creating the feeder file, and if I create more than opne file it gets
stored with the count after it as in:


Feeder.xls
Feeder(1).xls
Feeder(2).xls etc


I know exactly where the file will be (in what folder and drive), I
just dont have a clue as to how to write a macro to remove it. I am
using Excel 2000.


Thanks in advance


John Baker


--

Dave Peterson


Thank you very much!
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
how do i delete a file from recent documents file in excel exile New Users to Excel 1 March 7th 09 01:59 AM
code to delete module / macro in another file Ray Clark[_2_] Excel Discussion (Misc queries) 1 July 3rd 08 04:15 AM
delete info from source file w/out changing the destination file TB New Users to Excel 0 May 26th 08 06:26 PM
Open & delete file using a macro Dode Excel Discussion (Misc queries) 3 December 5th 07 07:25 PM
Can't find macro in an Excel file to delete it Ron Excel Discussion (Misc queries) 3 July 1st 05 01:07 PM


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