ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can a macro delete itself? (https://www.excelbanter.com/excel-programming/314690-can-macro-delete-itself.html)

OceansideDJ

Can a macro delete itself?
 
My auto_run macro imports a text file, formats a report, asks the user for a
FileSaveAs filename, and finally saves a copy of the spreadsheet.

Now, I do not want the macro to run again, in this saved copy. Can the macro
delete itself, or rename itself, or disable itself, or save a copy of the
spreadsheet with no macros? Anythng to never run again.

Thanks,

Mike



david mcritchie

Can a macro delete itself?
 
Hi Mike,
Sure, see Chip Pearson's page.
Coding to the VBE
http://www.cpearson.com/excel/vbe.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"OceansideDJ" wrote in message ...
My auto_run macro imports a text file, formats a report, asks the user for a
FileSaveAs filename, and finally saves a copy of the spreadsheet.

Now, I do not want the macro to run again, in this saved copy. Can the macro
delete itself, or rename itself, or disable itself, or save a copy of the
spreadsheet with no macros? Anythng to never run again.

Thanks,

Mike






All times are GMT +1. The time now is 01:39 AM.

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