ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I delete an xls file using a .xl macro in a different file? (https://www.excelbanter.com/excel-discussion-misc-queries/238711-how-do-i-delete-xls-file-using-xl-macro-different-file.html)

JHB

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

Dave Peterson

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

Per Jessen

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



JHB

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!


All times are GMT +1. The time now is 07:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com