ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple Macro to Delete an Excel file at a specific Folder Location (https://www.excelbanter.com/excel-programming/454506-simple-macro-delete-excel-file-specific-folder-location.html)

James[_48_]

Simple Macro to Delete an Excel file at a specific Folder Location
 
Hello - Could someone possibly let me know what VBA code to use that will simply delete an Excel File at a particular location (on my desktop)?

Not sure if it matters, but I am using Office/Excel 2010

And if it helps, the exact folder location is below.

C:\Users\James\SkyDrive\SkyPLT\MainSellerAccount\I mports\DailyImportTemplate\NONSPECPRICING


This is probably not relevant, but as an FYI, I will be running this new code PRIOR to running another VBA Macro (that I run daily) that requires that the file that is being deleted is not there, in order to begin. This is because that other VBA Macro seems to be turning off the Macros in that folder, and thus disallowing the Microsoft Access export to export the updated file to that location.

GS[_6_]

Simple Macro to Delete an Excel file at a specific Folder Location
 
Hello - Could someone possibly let me know what VBA code to use that will
simply delete an Excel File at a particular location (on my desktop)?

Not sure if it matters, but I am using Office/Excel 2010

And if it helps, the exact folder location is below.

C:\Users\James\SkyDrive\SkyPLT\MainSellerAccount\I mports\DailyImportTemplate\NONSPECPRICING


This is probably not relevant, but as an FYI, I will be running this new code
PRIOR to running another VBA Macro (that I run daily) that requires that the
file that is being deleted is not there, in order to begin. This is because
that other VBA Macro seems to be turning off the Macros in that folder, and
thus disallowing the Microsoft Access export to export the updated file to
that location.


Have a look at the VBA Kill() function!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


All times are GMT +1. The time now is 01:19 PM.

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