Deleting Workbook

F

Fred

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
 
C

Charles Maxson

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....
 
G

Guest

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





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top