Hello,
I've got an Excel-sheet with a macro for my work, but because the Excel-file will be send to a lot of offices when I'm done with it, I want to add a rule in the macro that "self-destructs" the macro... Is this possible?
Best regards,
Chris
Hello,
I've got an Excel-sheet with a macro for my work, but because the Excel-file will be send to a lot of offices when I'm done with it, I want to add a rule in the macro that "self-destructs" the macro... Is this possible?
Best regards,
Chris
Last edited by Sharkey79; 06-21-2011 at 07:18 AM.
You can save it as a .csv file.
In E2007 you can save it as an xlsx file.
Last edited by snb; 06-21-2011 at 05:39 AM.
Hi snb,
Although you're answer might work and you are appreciated for it, it's not what I want...
Is there a way to make the macro delete itself?
Chris
Why would you want to avoid the simplest method ?
Because multiple people have to be able to use it without the knowledge of Excel. A key combination everyone can remember without to many questions. Saving it in a different file-extension is another story...
There's info here on deleting all the code in a project: http://www.cpearson.com/excel/vbe.aspx
I'd agree with snb though in that you'd be better off just saving it as a macro free file.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
You can even build a macro that performs everything. They don't even have to remember any key combination at all.
![]()
Please Login or Register to view this content.
Hi Domski,
Thanks for the tip and the advice... I'll try the method on the site and see what works best for me (and my colleagues).
Chris
Please do not quote.
When the user closes eg. the file "E:\OF\example.xls" it will automatically also be saved as "E:\OF\example.csv".
This file doesn't contain macro's. When a user opens it in Excel it's automatically a workbook and can be used/written into as a normal Excelfile.
There are many more methods depending on what you wish (keep the formatting or only the data, whether the workbook contains 1 or more sheets, etc.)
Using Chip Pearson's code you would not be able to protect the VBA project
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
@snb
Off topic: What's wrong with "quoting"??
On topic: Okay, that sounds good! Couldn't get the Chip Pearson to work (gives an error) so that would be the best way to go. And you're macro would also help a lot on another problem I've got! Thanks a million snb!
Apparently you didn't read the forum rules (nr. 12)Off topic: What's wrong with "quoting"??
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks