ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Code to delete an Excel File (https://www.excelbanter.com/excel-discussion-misc-queries/191946-code-delete-excel-file.html)

Ray Clark[_2_]

Code to delete an Excel File
 
I must be missing something but I am having trouble trying to write a macro
to delete and Excel file. I have tried the following but does not work......
Application.Workbooks("N:\MaintCo-ord\Mech\Maint Day Roster for
Viewing.xls").Delete
Can anyone point me in the right direction.

Thanks
Ray

jaf

Code to delete an Excel File
 
Ray,
The VB VBA command is KILL.

Kill "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls"

John

"Ray Clark" wrote in message
...
I must be missing something but I am having trouble trying to write a macro
to delete and Excel file. I have tried the following but does not
work......
Application.Workbooks("N:\MaintCo-ord\Mech\Maint Day Roster for
Viewing.xls").Delete
Can anyone point me in the right direction.

Thanks
Ray



Ray Clark[_2_]

Code to delete an Excel File
 
John,

Thank you this was a great help as had not picked this up before. Much
appreciated.
Ray

"jaf" wrote:

Ray,
The VB VBA command is KILL.

Kill "N:\MaintCo-ord\Mech\Maint Day Roster for Viewing.xls"

John

"Ray Clark" wrote in message
...
I must be missing something but I am having trouble trying to write a macro
to delete and Excel file. I have tried the following but does not
work......
Application.Workbooks("N:\MaintCo-ord\Mech\Maint Day Roster for
Viewing.xls").Delete
Can anyone point me in the right direction.

Thanks
Ray





All times are GMT +1. The time now is 12:26 AM.

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