ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting Workbook (https://www.excelbanter.com/excel-programming/283683-deleting-workbook.html)

Fred[_16_]

Deleting Workbook
 
I've written some code that creates a workbook, emails it
to specific users, then closes it. I'd like to have my
code go in a delete the workbook. Any suggestions?
Thanks - Fred

Charles Maxson

Deleting Workbook
 
Fred,

Just kill it!.... no really...

Try this:

Kill "C:\Documents and Settings\Administrator\Desktop\Book1.xls"

Of course you need to use the right file name. Also note you will have to
manage errors, such as File Not Found or Permission Denied (when the
workbook is open). But Kill will work....

--
Charles
www.officezealot.com


"Fred" wrote in message
...
I've written some code that creates a workbook, emails it
to specific users, then closes it. I'd like to have my
code go in a delete the workbook. Any suggestions?
Thanks - Fred




No Name

Deleting Workbook
 
That's perfect. Thanks!
-----Original Message-----
Fred,

Just kill it!.... no really...

Try this:

Kill "C:\Documents and

Settings\Administrator\Desktop\Book1.xls"

Of course you need to use the right file name. Also note

you will have to
manage errors, such as File Not Found or Permission

Denied (when the
workbook is open). But Kill will work....

--
Charles
www.officezealot.com


"Fred" wrote in

message
...
I've written some code that creates a workbook, emails

it
to specific users, then closes it. I'd like to have my
code go in a delete the workbook. Any suggestions?
Thanks - Fred



.



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

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