ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro - Deleting. (https://www.excelbanter.com/excel-programming/417734-macro-deleting.html)

dolores

Macro - Deleting.
 
I am able to modify macro, but I cannot create one from scratch. With that
being said, I would like to create a macro that would delete a workbook. If
this is possible can someone give me the codes that need to be used.

Thanks,


Harald Staff[_2_]

Macro - Deleting.
 
Hi

It's not that hard. You type "sub " and a unique name in a module and hit
Enter -and there's the macro.
Problem is to make it do reasonable things. To delete a workbook saved on
file, type something like

Sub Kill()
Kill "C:\Temp\Book1.xls"
End Sub

assuming that you want to delete Book1.xls stored in C:\Temp and that it is
not in use at the time.

HTH. Best wishes Harald

"Dolores" wrote in message
...
I am able to modify macro, but I cannot create one from scratch. With
that
being said, I would like to create a macro that would delete a workbook.
If
this is possible can someone give me the codes that need to be used.

Thanks,



dolores

Macro - Deleting.
 
Thanks Harald. This was very helpful

"Harald Staff" wrote:

Hi

It's not that hard. You type "sub " and a unique name in a module and hit
Enter -and there's the macro.
Problem is to make it do reasonable things. To delete a workbook saved on
file, type something like

Sub Kill()
Kill "C:\Temp\Book1.xls"
End Sub

assuming that you want to delete Book1.xls stored in C:\Temp and that it is
not in use at the time.

HTH. Best wishes Harald

"Dolores" wrote in message
...
I am able to modify macro, but I cannot create one from scratch. With
that
being said, I would like to create a macro that would delete a workbook.
If
this is possible can someone give me the codes that need to be used.

Thanks,




NgS

Macro - Deleting.
 
Hi Harald,

My excel is 2007 and VB is 6.5. i tried, but encounter "can't execute code
in break mode" error.

Cheers

"Dolores" wrote:

Thanks Harald. This was very helpful

"Harald Staff" wrote:

Hi

It's not that hard. You type "sub " and a unique name in a module and hit
Enter -and there's the macro.
Problem is to make it do reasonable things. To delete a workbook saved on
file, type something like

Sub Kill()
Kill "C:\Temp\Book1.xls"
End Sub

assuming that you want to delete Book1.xls stored in C:\Temp and that it is
not in use at the time.

HTH. Best wishes Harald

"Dolores" wrote in message
...
I am able to modify macro, but I cannot create one from scratch. With
that
being said, I would like to create a macro that would delete a workbook.
If
this is possible can someone give me the codes that need to be used.

Thanks,





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

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